Skip to content

Add support for command mode #2

Description

@hattan

shArg currently works with switch parameters (- or --) this proposal is to add support for sub commands.

A sub command can be along the lines of

./script.sh

An example would be

# test.sh

envCommand() {
  local commandName=$1

}

shArgs.command "env" "envCommand"

# parse inputs
shArgs.parseCommands $@

Invoked with

# invoke the env command with the reload sub command
./test.sh env reload -d

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions