Comments (5)
Not as an alias. Adding a cli help
is actually equivalent to adding a command.
You can easily do it using this bashly.yml
setup:
name: cli
help: Sample application
version: 0.1.0
commands:
- name: help
help: Show help
and after running bashly g
, you will get the src/help_command.sh
placeholder - put this content in it:
long_usage=yes
cli_usage
which is exactly what is being called when you run cli --help
.
Does this work for you?
The nice thing about this, is that you can also adopt this function to allow cli help COMMAND
to get help for different commands.
See this example for a nice implementation.
from bashly.
Well for all commands I get
No help available for this command
I wonder what am I doing wrong?
I also found another solution
with
extensible: true
and cli-help script
but your seems more practical
regards
from bashly.
Well, look at your generated script, and search for "--help" to see which function it calls.
All the occurrences of cli_*
in the example, should be replaced with your script name (the cli
prefix is the name of the default script) - lines 6 and 9 below.
bashly/examples/help-command/src/help_command.sh
Lines 4 to 10 in 46c0f4e
As for the extensible
option, it is not intended for it, although it can be used for it.
Bashly's goal is to have everything you need to write a good bash script in it. The extensible
option is meant for you to give the users of your script the ability to extend it themselves if they want.
from bashly.
excellent !
I missed that my script is cli2
now it works
thank you
regards
from bashly.
Glad I could help.
from bashly.
Related Issues (20)
- Support for Alternate Dependencies HOT 12
- bashly about “The goal is to generate a new file and fill it with many variables” HOT 2
- Do something when a root command's flag is set HOT 8
- The `initialize` file is not loaded when using `.bash` extension
- Treat `initialize.sh` like the `before` and `after` hooks
- Automatically execute bashly generate when file change HOT 3
- Support storing variable via yaml file HOT 4
- `allowed` incompatible with `required: false` HOT 6
- Flags should not be set to their default value if not explicitly used HOT 3
- Flags must have a long form if you specify a default value HOT 3
- Whitespace not respected in here documents HOT 1
- Decide whether to use `bashly-` prefix for YAML configs HOT 6
- `bashly` completions for Bash, Fish, Zsh HOT 17
- Private commands appear in completion suggestion
- Questions about generated scripts (set -e) HOT 2
- Color escape sequences are not correctly shown in terminal HOT 8
- Organize scripts in src dir in subdirectories HOT 8
- Pass bashly.yml through ERB HOT 8
- Launch error on Ubuntu WSL 22.04 after fresh installation [SOLVED] HOT 5
- Include a subcommand's args/flags in the generated script file's comments HOT 2
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 bashly.