-
Notifications
You must be signed in to change notification settings - Fork 53
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
Add --list-options
and shell completions
#377
Add --list-options
and shell completions
#377
Conversation
212d429
to
774ac94
Compare
Not sure how to tackle this one. Shell completion script dirs are not as well "standardized" as Maybe we shouldn't try to install the completion files and just let distro packagers install it to appropriate directory for the respective distro. Or make it so that completion files will be installed only when explicitly requested via something like |
I'm thinking we could probably just remove the current usage string entirely and utilize the new $ ./scrot -h
Usage: scrot [OPTIONS] [FILE]
OPTIONS
=======
-a, --autoselect <x,y,w,h> autoselect provided region
-b, --border capture the window borders as well
-C, --class <NAME> capture specified window class
-c, --count display a countdown for delay
-D, --display <DISPLAY> capture specified display
-d, --delay <[b]SEC> add delay before screenshot
-e, --exec <CMD> execute command on saved image
-F, --file <FILE> specify output file
-f, --freeze freeze the screen when -s is used
-h, --help display help and exit
-i, --ignorekeyboard ignore keyboard
-k, --stack[=v|h] capture overlapped window and join them
-l, --line <STYLE> specify the style of the selection line
-M, --monitor <NUM> capture monitor
-m, --multidisp capture all monitors
-o, --overwrite overwrite the output file if needed
-p, --pointer capture the mouse pointer as well
-q, --quality <NUM> image quality
-s, --select[=OPTS] interactively select a region to capture
-t, --thumb <% | WxH> also generate a thumbnail
-u, --focused capture the currently focused window
-u, --focussed capture the currently focused window
-v, --version output version and exit
-w, --window <WID> X window ID to capture
-Z, --compression <LVL> image compression level
-z, --silent prevent beeping
--format <FMT> specify output file format
--list-options[=human|tsv] list all options This seems significantly more helpful than the current EDIT: Updated the |
2d8c228
to
171f38b
Compare
5b14c2e
to
4cf3ce8
Compare
--list-options
and zsh completion--list-options
and shell completions
Any feedback on this? I'd like to merge this and cut a release sometime this week. |
In this one, as in previous commits ;-) the copyright date needs to be updated. |
I like this one better, if possible, I don't know. But making a target in Makefile ala |
It would be necessary to add the diff --git a/Makefile.am b/Makefile.am
index 63e275e..497b212 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -40,6 +40,8 @@ dist_doc_DATA = AUTHORS ChangeLog CONTRIBUTING.md doc/scrot.png FAQ.md README.md
EXTRA_DIST = $(man_MANS) autogen.sh deps.pc
+EXTRA_DIST += etc/
+
SUBDIRS = src
distclean-local: |
Good catch. Fixed.
I will go through all the commits since the previous version and update the copyright date in another commit.
That was okay in the past, but currently we have long options which have no short options (e.g |
shows a more detailed list of options now via the `--list-options` flag.
Hi, The new options are: --with-zsh-confpath install autocomplete zsh files
--with-bash-confpath install autocomplete bash files Example: $ ./configure --with-zsh-confpath
configure: error: the variable ZSH_CONFPATH no set It expects to find a $ ./configure --prefix=/usr/local --with-zsh-confpath ZSH_CONFPATH=/tmp/zsh-autocompletion Then we install to test: make DESTDIR=/tmp/scrot install It is installed on: That is an approximation, it would be necessary to see if there is a better or more robust one because this patch does not uninstall the shell files for example. |
I think that's probably fine, but I'm not sure.
Can we make it so that the path is given as an argument? E.g: $ ./configure --with-zsh-confpath=/tmp/zsh-complete I think this is more easy to use. |
9c6da4b
into
resurrecting-open-source-projects:master
I've merged this PR since the autocompletion itself works.
For installing the files, you can now create your own PR. I'm not good with autoconf, so I wouldn't be able to do it myself anyways. |
El Tue, 04 Jun 2024 00:06:27 -0700
NRK ***@***.***> escribió:
I've merged this PR since the autocompletion itself works.
> I attach the patch.
For installing the files, you can now create your own PR. I'm not good with autoconf, so I wouldn't be able to do it anyways.
Ok, as soon as I can I'll make a PR and we'll continue it there.
Regards.
|
@daltomi I was thinking it might be time for a release. Do you think we should wait to add autoconf/makefile completion installation before making a release? I think most distros/package-managers will not have any trouble installing those files. It will be useful only for people who are not using package manager and using |
El Sun, 09 Jun 2024 11:28:23 -0700
NRK ***@***.***> escribió:
@daltomi I was thinking it might be time for a release. Do you think we should wait to add autoconf/makefile completion installation before making a release?
I think most distros/package-managers will not have any trouble installing those files.
Hi,
Yes, it's okay with me.
|
This adds a
--list-options
flag which outputs a specialized TSV of all the options intended to be used in shell completion scripts. A couple TODOs:--list-options
accept an optional argument. By default it should output human readable format, but when using--list-options=tsv
it would output the TSV.make install
should install the zsh completion script--list-options
to manpage etc--help
output also include (human readable) list of options??