Bash auto-completion for Linux platforms

Like feature suggestions, but you've actually written code to make it happen. More likely to make it into the game than some random request in feature suggestions.

Moderator: Developers

Forum rules
Please see Code submission guidelines

GZDoom Status:
Image Image

QZDoom Status:
Image Image

Bash auto-completion for Linux platforms

Postby Caligari87 » Fri Jun 09, 2017 4:09 pm

Not sure where the right place to put this is, as it's Linux-specific and I'm not sure how installation paths are determined in the GitHub source. Hope that's not a problem.

In short, this file will provide command-line auto-completion for gzdoom when running in a (ba)sh terminal. I built it from a template at this page. Per that page, on Debian-based platforms at least, this file (named simply "gzdoom") may be placed or softlinked into "/etc/bash_completion.d/". I've done that on my Linux Mint system and it works like a charm.

UPDATED: autocompletes directories/files now
Spoiler:

I used the wiki page on Command line parameters to get the options I included, minus the Zandronum-specific section. There's probably additional possibilities which could be added, both static and context-sensitive.

8-)
Last edited by Caligari87 on Mon Jun 12, 2017 9:17 pm, edited 1 time in total.
User avatar
Caligari87
I'm just here for the community
 
Joined: 26 Feb 2004
Location: Salt Lake City, Utah, USA
Discord: Caligari87#3089

Re: Bash auto-completion for Linux platforms

Postby Caligari87 » Mon Jun 12, 2017 5:48 pm

I've discovered that the autocomplete script above doesn't work for filenames/directories, so I'm trying to figure out the appropriate fix. If anyone has any experience with bash scripting and autocompletion, help appreciated.

8-)
User avatar
Caligari87
I'm just here for the community
 
Joined: 26 Feb 2004
Location: Salt Lake City, Utah, USA
Discord: Caligari87#3089

Re: Bash auto-completion for Linux platforms

Postby Caligari87 » Mon Jun 12, 2017 9:19 pm

Got generalized directory/file completion working, updated the script in the OP. It's not as fancy as it could be (such as only allowing file autocomplete for options that accept it) but it gets the job done.

8-)
User avatar
Caligari87
I'm just here for the community
 
Joined: 26 Feb 2004
Location: Salt Lake City, Utah, USA
Discord: Caligari87#3089

Re: Bash auto-completion for Linux platforms

Postby Rachael » Wed Jul 19, 2017 12:41 pm

Have you tried PM'ing Blzut3 about this?

He could update his packages with this.
User avatar
Rachael
QZDoom Project Lead + Webmaster
 
Joined: 13 Jan 2004


Return to Code Submissions

Who is online

Users browsing this forum: No registered users and 1 guest