Unverified Commit 2b91cb02 authored by Fabien Chouteau's avatar Fabien Chouteau Committed by GitHub
Browse files

Extract sub-command handling (alr <command>) (#806)

* Extract sub-command handling (alr <command>)

The goal of this big refactoring is to extract the handling of
sub-commands to make it available for other projects.

The SubCommander packages (name open to changes) can be extracted to a
dedicated crate or to AAA.

There is at least one regression which is the support of -X for alr
build.

* Alr.Commands.Toolchain: Fix comparison typo from refactoring

* Alr.Commands|SubCommander: Fix exception raise and handling

* Typo

* Address review comments and minor changes

* Another big refactoring on command line handling

The switches are not parsed several times like before.  The global
switches parsing is done once, the command specific switch parsing is
done only on the command arguments.

Handling of -X scenario variable switches is now done with regular
GNAT.Command_Line switch handling.

There is a issue with command arguments that contain spaces, it looks
like they are split in multiple arguments. I don't know why.

* Fix args filtering

The concatenation of arguments and re-splitting with
GNAT.OS_Lib.Argument_String_To_List breaks when arguments have
whitespaces: 'alr' 'show' 'a b c' becomes 'alr 'show' 'a' 'b' 'c'.

* Wrap the GNAT Commnand_Line_Configuration to add required features

This was previously done with a GNAT.Command_Line.Extra package that
exploited the internals of GNAT.Command_Line.

This is more portable because less exposed to changes in the internals
of GNAT.Command_Line.

* Rename SubCommander to CLIC.Subcommander and move it to alire/

* Move Alire.Utils.User_Input and Alire.Utils.TTY to CLIC

* Alr.Platforms.Windows: Fix builds

* Import CLIC as submodule
parent 1b89612c
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment