Re: [chrony-users] [patch] adds tab-completion to chronyc
On Thu, Dec 08, 2016 at 07:59:24AM -0600, Lonnie Abelbeck wrote: > On Dec 8, 2016, at 12:36 AM, Miroslav Lichvarwrote: > > Thanks, Lonnie. This is useful. Would it be possible to parse the list > > of commands from the usage text instead of maintaining a separate > > list? The chronyc support in bash-completition works like that. > > I presume you meant the "help" output ... Yes, I briefly looked at that, > probably more code would be required than the data size of command_names[], > and the command_names[] entries can be tweaked specifically for > tab-completion. > > My thought is to keep things simple (as this patch does) and have a separate > tab-completion list. > > Possibly, down the road. give_help() text, process_line() parsing matches, > and tab-completion text could all be in one structure, but probably not worth > stirring-the-code over. Ok, fair enough. The patch looks good to me and it seems to be working nicely. I'll just make the strings const and move them so they are closer to the help text and it's less likely to update one without the other. I hope that's ok with you. Thanks, -- Miroslav Lichvar -- To unsubscribe email chrony-users-requ...@chrony.tuxfamily.org with "unsubscribe" in the subject. For help email chrony-users-requ...@chrony.tuxfamily.org with "help" in the subject. Trouble? Email listmas...@chrony.tuxfamily.org.
Re: [chrony-users] [patch] adds tab-completion to chronyc
On Dec 8, 2016, at 12:36 AM, Miroslav Lichvarwrote: > On Wed, Dec 07, 2016 at 03:33:37PM -0600, Lonnie Abelbeck wrote: >> Hi Miroslav, >> >> Attached is a patch I created (against chrony 2.4.1) to add tab-completion >> to chronyc. A relatively simple addition. >> >> Also here: >> https://sourceforge.net/p/astlinux/code/8023/tree//branches/1.0/package/chrony/chrony-0100-chronyc-tab-completion.patch >> >> Works quite well in my testing, using either libedit 20160903-3.1 or >> readline 7.0 . All cross-compiled from source. > > Thanks, Lonnie. This is useful. Would it be possible to parse the list > of commands from the usage text instead of maintaining a separate > list? The chronyc support in bash-completition works like that. I presume you meant the "help" output ... Yes, I briefly looked at that, probably more code would be required than the data size of command_names[], and the command_names[] entries can be tweaked specifically for tab-completion. My thought is to keep things simple (as this patch does) and have a separate tab-completion list. Possibly, down the road. give_help() text, process_line() parsing matches, and tab-completion text could all be in one structure, but probably not worth stirring-the-code over. > However, there are some recommendations for submitting patches. They > should go to the chrony-dev list and they should be git patches > against HEAD. I'd at least need an email address to which I can set > the author field in git. Attached is a git patch against HEAD. Next time I will use the chrony-dev list. :-) Lonnie 0001-add-tab-completion-to-chronyc-with-libedit-readline.patch Description: Binary data
Re: [chrony-users] [patch] adds tab-completion to chronyc
On Wed, Dec 07, 2016 at 03:33:37PM -0600, Lonnie Abelbeck wrote: > Hi Miroslav, > > Attached is a patch I created (against chrony 2.4.1) to add tab-completion to > chronyc. A relatively simple addition. > > Also here: > https://sourceforge.net/p/astlinux/code/8023/tree//branches/1.0/package/chrony/chrony-0100-chronyc-tab-completion.patch > > Works quite well in my testing, using either libedit 20160903-3.1 or readline > 7.0 . All cross-compiled from source. Thanks, Lonnie. This is useful. Would it be possible to parse the list of commands from the usage text instead of maintaining a separate list? The chronyc support in bash-completition works like that. However, there are some recommendations for submitting patches. They should go to the chrony-dev list and they should be git patches against HEAD. I'd at least need an email address to which I can set the author field in git. -- Miroslav Lichvar -- To unsubscribe email chrony-users-requ...@chrony.tuxfamily.org with "unsubscribe" in the subject. For help email chrony-users-requ...@chrony.tuxfamily.org with "help" in the subject. Trouble? Email listmas...@chrony.tuxfamily.org.