Bash auto-completion for Linux platforms

Moderator: GZDoom Developers

Post Reply
User avatar
Caligari87
Admin
Posts: 6174
Joined: Thu Feb 26, 2004 3:02 pm
Preferred Pronouns: He/Him
Contact:

Bash auto-completion for Linux platforms

Post by Caligari87 »

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 [wiki]Command line parameters[/wiki] 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 8:17 pm, edited 1 time in total.
User avatar
Caligari87
Admin
Posts: 6174
Joined: Thu Feb 26, 2004 3:02 pm
Preferred Pronouns: He/Him
Contact:

Re: Bash auto-completion for Linux platforms

Post by Caligari87 »

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
Admin
Posts: 6174
Joined: Thu Feb 26, 2004 3:02 pm
Preferred Pronouns: He/Him
Contact:

Re: Bash auto-completion for Linux platforms

Post by Caligari87 »

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
Rachael
Posts: 13530
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: Bash auto-completion for Linux platforms

Post by Rachael »

Have you tried PM'ing Blzut3 about this?

He could update his packages with this.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49056
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Bash auto-completion for Linux platforms

Post by Graf Zahl »

Anything up here. I think this can be closed after lying dead for 8 months.
Post Reply

Return to “Closed Feature Suggestions [GZDoom]”