Comments (1)
Hi,
I have not tried this, but it should already be supported.
e.g.:
command sub-command1 sub-sub-command1
Supplemented it with options/arguments to make it look like follows:
command [global-options] sub-cmd1 [options-for-sub-cmd1] sub-sub-cmd1 [options-for-sub-sub-cmd1] [arguments]
To parse it, we need to perform three parses.
First parse (for command):
command [global-options] <sub-cmd> {doesn't care about the rest}
Second parse (for sub-cmd1):
sub-cmd1 [options-for-sub-cmd1] <sub-sub-cmd> {doesn't care about the rest}
Third parse (for sub-sub-cmd1):
sub-sub-cmd1 [options-for-sub-sub-cmd1] [arguments]
In other words, the number of subcommands+1 parser definition is required. Defining this in a single shell script would make it hard to read, but if we were developing something large enough to require this, we will separate each subcommand into its own file. In other words, the parser definition is defined in the main shell script and in the shell script for each subcommand.
See also #16.
from getoptions.
Related Issues (20)
- READMEにAURについて追記する HOT 3
- question/help - how to parse to display help (-h) message if there is zero option HOT 1
- No output from gengetoptions embed --overwrite example.sh HOT 2
- Error using gengetoptions parser ./parser_definition.sh parse prog > parser.sh HOT 2
- [Question] Is there any way to ignore not defined option? HOT 1
- Confusion about on: and no: in flag and option HOT 1
- Difference between param and option HOT 3
- Brew upgrade warning HOT 1
- recursion: parse arguments from file HOT 1
- Mandatory/optional parameters HOT 1
- 初期値のバックスラッシュが自動的にエスケープされる HOT 2
- Brew tap ko1nksm/getoptions throws an Error HOT 1
- Missing information about how to use getoptions HOT 2
- support the option grammar HOT 1
- Fix SC2004 HOT 2
- Support option names with hyphens HOT 1
- Init attribute for options does not work HOT 3
- Init attribute not working for parameters HOT 1
- Embedding with subcmd HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from getoptions.