Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wizard mode #218

Merged
merged 8 commits into from
Jul 15, 2023
Merged

Wizard mode #218

merged 8 commits into from
Jul 15, 2023

Conversation

pablf
Copy link
Member

@pablf pablf commented Jul 5, 2023

Full implementation of Wizard mode, /claim #24. Functionality:

  • User-friendly menus that explain the user what to do
  • Prints resulting command after executing wizard mode for later use
  • Executes constructed command
  • Shows helpDoc when entering help
  • Supports restarting and quitting Wizard mode when user inputs restarting and quitting

If some of the behaviour or appearance is not the desired one, please tell me!

Output using example StringUtil:

   _____@  __ @       @   _ @       @        @       @  __  __@  __ @   _ @   __@
  / ___/@ / /_@  _____@  (_)@  ____ @  ____ _@       @ / / / /@ / /_@  (_)@  / /@
  \__ \ @/ __/@ / ___/@ / / @ / __ \@ / __ `/@       @/ / / / @/ __/@ / / @ / / @
 ___/ / / /_  @/ /    @/ /  @/ / / /@/ /_/ / @       / /_/ /  / /_  @/ /  @/ /  @
/____/  \__/  /_/     /_/   /_/ /_/ @\__, /  @       \____/   \__/  /_/   /_/   @
        @     @       @     @       /____/   @       @        @     @     @     @


WIZARD of String Util0.0.1 -- CLI to some string utilities

Wizard mode assist you in constructing commands for String Util0.0.1


WIZARD

  Please, enter the command you would like to execute.

  Write help for more information about this parameter, restart to start again Wizard mode and quit
  to exit.


OPTIONS

  [1]    split  Split a string into substrings and display as an array

  [2]    join   Join the command-arguments into a single string

string-util :> asd  
   _____@  __ @       @   _ @       @        @       @  __  __@  __ @   _ @   __@
  / ___/@ / /_@  _____@  (_)@  ____ @  ____ _@       @ / / / /@ / /_@  (_)@  / /@
  \__ \ @/ __/@ / ___/@ / / @ / __ \@ / __ `/@       @/ / / / @/ __/@ / / @ / / @
 ___/ / / /_  @/ /    @/ /  @/ / / /@/ /_/ / @       / /_/ /  / /_  @/ /  @/ /  @
/____/  \__/  /_/     /_/   /_/ /_/ @\__, /  @       \____/   \__/  /_/   /_/   @
        @     @       @     @       /____/   @       @        @     @     @     @


WIZARD of String Util0.0.1 -- CLI to some string utilities

Wizard mode assist you in constructing commands for String Util0.0.1


WIZARD

  "asd" was not a valid input. Please, enter the command you would like to execute.

  Write help for more information about this parameter, restart to start again Wizard mode and quit
  to exit.


OPTIONS

  [1]    split  Split a string into substrings and display as an array

  [2]    join   Join the command-arguments into a single string

string-util :> split
   _____@  __ @       @   _ @       @        @       @  __  __@  __ @   _ @   __@
  / ___/@ / /_@  _____@  (_)@  ____ @  ____ _@       @ / / / /@ / /_@  (_)@  / /@
  \__ \ @/ __/@ / ___/@ / / @ / __ \@ / __ `/@       @/ / / / @/ __/@ / / @ / / @
 ___/ / / /_  @/ /    @/ /  @/ / / /@/ /_/ / @       / /_/ /  / /_  @/ /  @/ /  @
/____/  \__/  /_/     /_/   /_/ /_/ @\__, /  @       \____/   \__/  /_/   /_/   @
        @     @       @     @       /____/   @       @        @     @     @     @


WIZARD of String Util0.0.1 -- CLI to some string utilities

Wizard mode assist you in constructing commands for String Util0.0.1


WIZARD

  Please, specify the following option.

  Option "first". Display just the first substring.

  Write help for more information about this parameter, restart to start again Wizard mode and quit
  to exit.


string-util :> help
   _____@  __ @       @   _ @       @        @       @  __  __@  __ @   _ @   __@
  / ___/@ / /_@  _____@  (_)@  ____ @  ____ _@       @ / / / /@ / /_@  (_)@  / /@
  \__ \ @/ __/@ / ___/@ / / @ / __ \@ / __ `/@       @/ / / / @/ __/@ / / @ / / @
 ___/ / / /_  @/ /    @/ /  @/ / / /@/ /_/ / @       / /_/ /  / /_  @/ /  @/ /  @
/____/  \__/  /_/     /_/   /_/ /_/ @\__, /  @       \____/   \__/  /_/   /_/   @
        @     @       @     @       /____/   @       @        @     @     @     @


WIZARD of String Util0.0.1 -- CLI to some string utilities

Wizard mode assist you in constructing commands for String Util0.0.1


WIZARD

  Please, specify the following option.

  (-f, --first)
    A true or false value.

    Display just the first substring.

    This setting is optional. Default: 'false'.


string-util :>    
   _____@  __ @       @   _ @       @        @       @  __  __@  __ @   _ @   __@
  / ___/@ / /_@  _____@  (_)@  ____ @  ____ _@       @ / / / /@ / /_@  (_)@  / /@
  \__ \ @/ __/@ / ___/@ / / @ / __ \@ / __ `/@       @/ / / / @/ __/@ / / @ / / @
 ___/ / / /_  @/ /    @/ /  @/ / / /@/ /_/ / @       / /_/ /  / /_  @/ /  @/ /  @
/____/  \__/  /_/     /_/   /_/ /_/ @\__, /  @       \____/   \__/  /_/   /_/   @
        @     @       @     @       /____/   @       @        @     @     @     @


WIZARD of String Util0.0.1 -- CLI to some string utilities

Wizard mode assist you in constructing commands for String Util0.0.1


WIZARD

  No text found. Please, specify the following option.

  Option "first". Display just the first substring.

  Write help for more information about this parameter, restart to start again Wizard mode and quit
  to exit.

string-util :> false
   _____@  __ @       @   _ @       @        @       @  __  __@  __ @   _ @   __@
  / ___/@ / /_@  _____@  (_)@  ____ @  ____ _@       @ / / / /@ / /_@  (_)@  / /@
  \__ \ @/ __/@ / ___/@ / / @ / __ \@ / __ `/@       @/ / / / @/ __/@ / / @ / / @
 ___/ / / /_  @/ /    @/ /  @/ / / /@/ /_/ / @       / /_/ /  / /_  @/ /  @/ /  @
/____/  \__/  /_/     /_/   /_/ /_/ @\__, /  @       \____/   \__/  /_/   /_/   @
        @     @       @     @       /____/   @       @        @     @     @     @


WIZARD of String Util0.0.1 -- CLI to some string utilities

Wizard mode assist you in constructing commands for String Util0.0.1


WIZARD

  Please, specify the following option.

  Option "separator". Separator regex.

  Write help for more information about this parameter, restart to start again Wizard mode and quit
  to exit.

string-util :> ,
   _____@  __ @       @   _ @       @        @       @  __  __@  __ @   _ @   __@
  / ___/@ / /_@  _____@  (_)@  ____ @  ____ _@       @ / / / /@ / /_@  (_)@  / /@
  \__ \ @/ __/@ / ___/@ / / @ / __ \@ / __ `/@       @/ / / / @/ __/@ / / @ / / @
 ___/ / / /_  @/ /    @/ /  @/ / / /@/ /_/ / @       / /_/ /  / /_  @/ /  @/ /  @
/____/  \__/  /_/     /_/   /_/ /_/ @\__, /  @       \____/   \__/  /_/   /_/   @
        @     @       @     @       /____/   @       @        @     @     @     @


WIZARD of String Util0.0.1 -- CLI to some string utilities

Wizard mode assist you in constructing commands for String Util0.0.1


WIZARD

  Please, specify the following argument.

  Argument <string>: String to split.

  Write help for more information about this parameter, restart to start again Wizard mode and quit
  to exit.

string-util :> asf,asdk
   _____@  __ @       @   _ @       @        @       @  __  __@  __ @   _ @   __@
  / ___/@ / /_@  _____@  (_)@  ____ @  ____ _@       @ / / / /@ / /_@  (_)@  / /@
  \__ \ @/ __/@ / ___/@ / / @ / __ \@ / __ `/@       @/ / / / @/ __/@ / / @ / / @
 ___/ / / /_  @/ /    @/ /  @/ / / /@/ /_/ / @       / /_/ /  / /_  @/ /  @/ /  @
/____/  \__/  /_/     /_/   /_/ /_/ @\__, /  @       \____/   \__/  /_/   /_/   @
        @     @       @     @       /____/   @       @        @     @     @     @


WIZARD of String Util0.0.1 -- CLI to some string utilities

Wizard mode assist you in constructing commands for String Util0.0.1

You may bypass the wizard and execute your command directly with the following options and arguments:

  split --separator , asf,asdk

Executing command...

[asf, asdk]

@jdegoes jdegoes merged commit ded6f16 into zio:master Jul 15, 2023
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants