Display options for command at the prompt

Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
Is there a way to script any Linux commands to prompt the user for input?
For example:
chage has many options
Options:
-d, --lastday LAST_DAY set date of last password change to LAST_DAY
-E, --expiredate EXPIRE_DATE set account expiration date to EXPIRE_DATE
-h, --help display this help message and exit
-I, --inactive INACTIVE set password inactive after expiration
to INACTIVE
-l, --list show account aging information
-m, --mindays MIN_DAYS set minimum number of days before password
change to MIN_DAYS
-M, --maxdays MAX_DAYS set maximim number of days before password
change to MAX_DAYS
-R, --root CHROOT_DIR directory to chroot into
-W, --warndays WARN_DAYS set expiration warning days to WARN_DAYS
I like to type in chage and get the above option and allow me to select one. This will help me to remember all the options rather than having to type chage -h every time.
linux command-line options
add a comment |Â
up vote
0
down vote
favorite
Is there a way to script any Linux commands to prompt the user for input?
For example:
chage has many options
Options:
-d, --lastday LAST_DAY set date of last password change to LAST_DAY
-E, --expiredate EXPIRE_DATE set account expiration date to EXPIRE_DATE
-h, --help display this help message and exit
-I, --inactive INACTIVE set password inactive after expiration
to INACTIVE
-l, --list show account aging information
-m, --mindays MIN_DAYS set minimum number of days before password
change to MIN_DAYS
-M, --maxdays MAX_DAYS set maximim number of days before password
change to MAX_DAYS
-R, --root CHROOT_DIR directory to chroot into
-W, --warndays WARN_DAYS set expiration warning days to WARN_DAYS
I like to type in chage and get the above option and allow me to select one. This will help me to remember all the options rather than having to type chage -h every time.
linux command-line options
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
Is there a way to script any Linux commands to prompt the user for input?
For example:
chage has many options
Options:
-d, --lastday LAST_DAY set date of last password change to LAST_DAY
-E, --expiredate EXPIRE_DATE set account expiration date to EXPIRE_DATE
-h, --help display this help message and exit
-I, --inactive INACTIVE set password inactive after expiration
to INACTIVE
-l, --list show account aging information
-m, --mindays MIN_DAYS set minimum number of days before password
change to MIN_DAYS
-M, --maxdays MAX_DAYS set maximim number of days before password
change to MAX_DAYS
-R, --root CHROOT_DIR directory to chroot into
-W, --warndays WARN_DAYS set expiration warning days to WARN_DAYS
I like to type in chage and get the above option and allow me to select one. This will help me to remember all the options rather than having to type chage -h every time.
linux command-line options
Is there a way to script any Linux commands to prompt the user for input?
For example:
chage has many options
Options:
-d, --lastday LAST_DAY set date of last password change to LAST_DAY
-E, --expiredate EXPIRE_DATE set account expiration date to EXPIRE_DATE
-h, --help display this help message and exit
-I, --inactive INACTIVE set password inactive after expiration
to INACTIVE
-l, --list show account aging information
-m, --mindays MIN_DAYS set minimum number of days before password
change to MIN_DAYS
-M, --maxdays MAX_DAYS set maximim number of days before password
change to MAX_DAYS
-R, --root CHROOT_DIR directory to chroot into
-W, --warndays WARN_DAYS set expiration warning days to WARN_DAYS
I like to type in chage and get the above option and allow me to select one. This will help me to remember all the options rather than having to type chage -h every time.
linux command-line options
linux command-line options
edited Aug 8 at 19:11
jasonwryan
47.1k14127178
47.1k14127178
asked Aug 8 at 18:10
Reza
1
1
add a comment |Â
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
2
down vote
Is there a way to script a specific command? Yes. Is there a way to generalize that to all commands? Not that I'm aware of.
That said, something that might help is bash-completion. With that, you can type the command and a - followed by a double tab and see the list of options available.
$ chage --<tab><tab>
--expiredate --inactive --list --mindays --warndays
--help --lastday --maxdays --root
$ chage <tab><tab>
<list of user names>
add a comment |Â
up vote
0
down vote
Zsh has the run-help widget, by default bound to ESCh, that will invoke the respective man page for the command at the prompt; eg.,
chageESCh
will open CHAGE(1).
quitting out of the man page will leave you back at the command prompt, ready to enter your options.
The widget is described in detail in man zshcontrib:
Accessing On-Line Help
The key sequence ESC h is normally bound by ZLE to execute the run-help widget (see zshzle(1)). This invokes the run-help command
with the command word from the current input line as its argument. By default, run-help is an alias for the man command, so this often fails when the command word is a shell builtin or a user-defined function. By redefining the run-help alias, one can improve the on-line help provided by the
shell.
As the man page notes, this widget is configurable to point to your own helpfiles (defined by HELPDIR), or others provided by the community.
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
2
down vote
Is there a way to script a specific command? Yes. Is there a way to generalize that to all commands? Not that I'm aware of.
That said, something that might help is bash-completion. With that, you can type the command and a - followed by a double tab and see the list of options available.
$ chage --<tab><tab>
--expiredate --inactive --list --mindays --warndays
--help --lastday --maxdays --root
$ chage <tab><tab>
<list of user names>
add a comment |Â
up vote
2
down vote
Is there a way to script a specific command? Yes. Is there a way to generalize that to all commands? Not that I'm aware of.
That said, something that might help is bash-completion. With that, you can type the command and a - followed by a double tab and see the list of options available.
$ chage --<tab><tab>
--expiredate --inactive --list --mindays --warndays
--help --lastday --maxdays --root
$ chage <tab><tab>
<list of user names>
add a comment |Â
up vote
2
down vote
up vote
2
down vote
Is there a way to script a specific command? Yes. Is there a way to generalize that to all commands? Not that I'm aware of.
That said, something that might help is bash-completion. With that, you can type the command and a - followed by a double tab and see the list of options available.
$ chage --<tab><tab>
--expiredate --inactive --list --mindays --warndays
--help --lastday --maxdays --root
$ chage <tab><tab>
<list of user names>
Is there a way to script a specific command? Yes. Is there a way to generalize that to all commands? Not that I'm aware of.
That said, something that might help is bash-completion. With that, you can type the command and a - followed by a double tab and see the list of options available.
$ chage --<tab><tab>
--expiredate --inactive --list --mindays --warndays
--help --lastday --maxdays --root
$ chage <tab><tab>
<list of user names>
answered Aug 8 at 18:17
Andy Dalton
4,8091520
4,8091520
add a comment |Â
add a comment |Â
up vote
0
down vote
Zsh has the run-help widget, by default bound to ESCh, that will invoke the respective man page for the command at the prompt; eg.,
chageESCh
will open CHAGE(1).
quitting out of the man page will leave you back at the command prompt, ready to enter your options.
The widget is described in detail in man zshcontrib:
Accessing On-Line Help
The key sequence ESC h is normally bound by ZLE to execute the run-help widget (see zshzle(1)). This invokes the run-help command
with the command word from the current input line as its argument. By default, run-help is an alias for the man command, so this often fails when the command word is a shell builtin or a user-defined function. By redefining the run-help alias, one can improve the on-line help provided by the
shell.
As the man page notes, this widget is configurable to point to your own helpfiles (defined by HELPDIR), or others provided by the community.
add a comment |Â
up vote
0
down vote
Zsh has the run-help widget, by default bound to ESCh, that will invoke the respective man page for the command at the prompt; eg.,
chageESCh
will open CHAGE(1).
quitting out of the man page will leave you back at the command prompt, ready to enter your options.
The widget is described in detail in man zshcontrib:
Accessing On-Line Help
The key sequence ESC h is normally bound by ZLE to execute the run-help widget (see zshzle(1)). This invokes the run-help command
with the command word from the current input line as its argument. By default, run-help is an alias for the man command, so this often fails when the command word is a shell builtin or a user-defined function. By redefining the run-help alias, one can improve the on-line help provided by the
shell.
As the man page notes, this widget is configurable to point to your own helpfiles (defined by HELPDIR), or others provided by the community.
add a comment |Â
up vote
0
down vote
up vote
0
down vote
Zsh has the run-help widget, by default bound to ESCh, that will invoke the respective man page for the command at the prompt; eg.,
chageESCh
will open CHAGE(1).
quitting out of the man page will leave you back at the command prompt, ready to enter your options.
The widget is described in detail in man zshcontrib:
Accessing On-Line Help
The key sequence ESC h is normally bound by ZLE to execute the run-help widget (see zshzle(1)). This invokes the run-help command
with the command word from the current input line as its argument. By default, run-help is an alias for the man command, so this often fails when the command word is a shell builtin or a user-defined function. By redefining the run-help alias, one can improve the on-line help provided by the
shell.
As the man page notes, this widget is configurable to point to your own helpfiles (defined by HELPDIR), or others provided by the community.
Zsh has the run-help widget, by default bound to ESCh, that will invoke the respective man page for the command at the prompt; eg.,
chageESCh
will open CHAGE(1).
quitting out of the man page will leave you back at the command prompt, ready to enter your options.
The widget is described in detail in man zshcontrib:
Accessing On-Line Help
The key sequence ESC h is normally bound by ZLE to execute the run-help widget (see zshzle(1)). This invokes the run-help command
with the command word from the current input line as its argument. By default, run-help is an alias for the man command, so this often fails when the command word is a shell builtin or a user-defined function. By redefining the run-help alias, one can improve the on-line help provided by the
shell.
As the man page notes, this widget is configurable to point to your own helpfiles (defined by HELPDIR), or others provided by the community.
answered Aug 8 at 18:50
jasonwryan
47.1k14127178
47.1k14127178
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f461332%2fdisplay-options-for-command-at-the-prompt%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password