Skip to content
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

Selection -m option delimiter #83

Closed
maandree opened this issue May 12, 2014 · 5 comments
Closed

Selection -m option delimiter #83

maandree opened this issue May 12, 2014 · 5 comments

Comments

@maandree
Copy link
Contributor

Currently : delimits options in -m and -l and = delimits the option name and its associated value.
Problems we are facing with this:

  • : delimits the hostname and the display index in the display name of an X display. in Rewrite of adjustment methods and a some other stuff #61 -m randr and -m vidmode have been extended to support selecting display. Additionally, : long with [ and ] are required for IPv6 address which can be used instead of a hostname.
  • : is used in to separate values for red, green and blue and gamma settings. If redshift is extended to support using multiple adjustment methods concurrently it will be sensible to support using -m multiple times, and thus it will make since to specify the gamma correction for each monitor in -m.
  • , is used to delimit CRTC:s in XRandR: Allow multiple but not all CRTCs to be redshifted #81 while allows the user to specify multiple CRTC:s in one -m. This feature should also be added the screen option and the display option offered by Rewrite of adjustment methods and a some other stuff #61.
  • , is not too good of an alternative as it could be used instead of . in floating point values.
  • The are serve other character that are not too good options either because they have special meaning for shells and have to be escaped or put in qoutes. This includes symbols such as ; and &.

So the question is, how should options be delimited in -m and -l?

@maandree
Copy link
Contributor Author

I suggest using separate arguments instead. For example:
redshift -m randr display=:0.0 screen=all crtc=1,2
I imagine that it would also be easier to write tab-completion
for Bash and other shells using this syntax.

@jonls
Copy link
Owner

jonls commented May 16, 2014

Your last suggestions seem to be the best option. Do you think this can be easily implemented using getopt() ? From quickly skimming the man page it seems not to be the case.

@maandree
Copy link
Contributor Author

I do not know, and I do not know any tool that can do it.
But if getopt does not support it, it should be fairly simple
to do a simple alternative that can do this since only
short options are used.

@maandree
Copy link
Contributor Author

I think it is possible by utilising the optind variable.
A wrapper around getopt should be written to simply
the code, but it seems possible without too much work.

@maandree
Copy link
Contributor Author

Implemented in #86, closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants