|
| 1 | +------------------------------------------------------------------------------- |
| 2 | +-- |
| 3 | +-- ALICE - Adventures for Learning and Inspiring Coding Excellence |
| 4 | +-- Copyright (c) 2023 Francesc Rocher <francesc.rocher@gmail.com> |
| 5 | +-- SPDX-License-Identifier: MIT |
| 6 | +-- |
| 7 | +------------------------------------------------------------------------------- |
| 8 | + |
| 9 | +with AAA.Strings; |
| 10 | +with CLIC.Subcommand; |
| 11 | + |
| 12 | +package Alice_Cmd.Source.Init is |
| 13 | + |
| 14 | + type Cmd_Type is new CLIC.Subcommand.Command with null record; |
| 15 | + |
| 16 | + overriding function Name |
| 17 | + (Cmd : Cmd_Type) return CLIC.Subcommand.Identifier is |
| 18 | + ("init"); |
| 19 | + |
| 20 | + overriding function Usage_Custom_Parameters |
| 21 | + (Cmd : Cmd_Type) return String is |
| 22 | + ("<problem_source>"); |
| 23 | + |
| 24 | + overriding function Short_Description (Cmd : Cmd_Type) return String is |
| 25 | + ("Initialize new Problem Source"); |
| 26 | + |
| 27 | + --!pp off |
| 28 | + pragma Style_Checks (off); |
| 29 | + |
| 30 | + overriding function Long_Description |
| 31 | + (Cmd : Cmd_Type) return AAA.Strings.Vector is |
| 32 | + (AAA.Strings.Empty_Vector |
| 33 | + .Append ("Initializes a new Problem Source directory, populating it with all required repositories and resources.") |
| 34 | + .New_Line |
| 35 | + .Append ("• Installs the repository 'alice-adventures/<problem_source>', which is, in turn, the crate '<problem_source>' in the 'alice' index (cloned with 'git', maintained with 'alr').") |
| 36 | + .New_Line |
| 37 | + .Append ("• Creates a new git repository in your GitHub account. This repository is named 'alice-<problem_source>', which is cloned from the repository 'alice-adventures/<problem_source>-template' repository.") |
| 38 | + .New_Line |
| 39 | + .Append ("• Your new repository is created in '<problem_source>/usr/<your_login>/'.") |
| 40 | + .New_Line |
| 41 | + .Append ("• Clone the repository '<problem_source>-share' to access all the required resources. This repository is cloned in '<problem_source>/share'.") |
| 42 | + .New_Line |
| 43 | + .Append ("Note: Check all the available Problem Sources with 'alice list'.") |
| 44 | + ); |
| 45 | + |
| 46 | + pragma Style_Checks (on); |
| 47 | + --!pp on |
| 48 | + |
| 49 | + overriding function Switch_Parsing |
| 50 | + (Cmd : Cmd_Type) return CLIC.Subcommand.Switch_Parsing_Kind is |
| 51 | + (CLIC.Subcommand.Parse_All); |
| 52 | + |
| 53 | + overriding procedure Setup_Switches |
| 54 | + (Cmd : in out Cmd_Type; |
| 55 | + Config : in out CLIC.Subcommand.Switches_Configuration) is null; |
| 56 | + |
| 57 | + overriding procedure Execute |
| 58 | + (Cmd : in out Cmd_Type; Args : AAA.Strings.Vector); |
| 59 | + |
| 60 | +private |
| 61 | + |
| 62 | + function Project_Euler return Boolean; |
| 63 | + |
| 64 | +end Alice_Cmd.Source.Init; |
0 commit comments