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

Completion for tlmgr not generated #3316

Closed
2 tasks done
feigaoxyz opened this issue Aug 21, 2016 · 3 comments
Closed
2 tasks done

Completion for tlmgr not generated #3316

feigaoxyz opened this issue Aug 21, 2016 · 3 comments

Comments

@feigaoxyz
Copy link

  • Have you checked if problem occurs with fish 2.3.1?
  • Tried fish without third-party customizations (check sh -c 'env HOME=$(mktemp -d) fish')?

fish version installed (fish --version):
fish, version 2.3.1-471-g044efef

OS/terminal used:
macOS 10.12, iTerm2-nightly

Talk about the the issue here:
No completion generated for tlmgr from man page,

Reproduction steps

Hard to explain? Link to a screen recording

See "Actual Results".

Expected results

Fish should complete tlmgr command

Actual results

$ sh -c 'env HOME=$(mktemp -d) fish'
Welcome to fish, the friendly interactive shell
Type help for instructions on how to use fish
feigao@feis-mbp ~> manpath
/usr/local/share/man:/usr/share/man:/Library/TeX/texbin/man:/Library/Developer/CommandLineTools/usr/share/man
feigao@feis-mbp ~> tree /Library/TeX/texbin/man/
/Library/TeX/texbin/man/
└── man1
    ├── tlmgr.1
    └── tlmgr.man1.pdf

1 directory, 2 files
feigao@feis-mbp ~> fish_update_completions
Parsing man pages and writing completions to /var/folders/2b/69mn6fzs56z166mj26r01c_w0000gn/T/tmp.5rwQIApz/.local/share/fish/generated_completions/
  2670 / 2670 : zic.8
feigao@feis-mbp ~> ls /var/folders/2b/69mn6fzs56z166mj26r01c_w0000gn/t/tmp.5rwQIApz/.local/share/fish/generated_completions/ | grep tlmgr
feigao@feis-mbp ~> type tlmgr
tlmgr is /Library/TeX/texbin/tlmgr
feigao@feis-mbp ~> man tlmgr | head
TLMGR(1)              User Contributed Perl Documentation             TLMGR(1)



NAME
       tlmgr - the native TeX Live Manager

SYNOPSIS
       tlmgr [option]... action [option]... [operand]...

@floam
Copy link
Member

floam commented Aug 21, 2016

Fish doesn't come with tlmgr completions. You could try to make some. 😉

I take it from your pasting that output there you were expecting/hoping that even though no one has yet made completions for tlmgr, it could have been picked up from the man page by fish_update_completions?

Given that tlmgr is a package manager, even if the manpage completions worked for the option switches it takes, it'd of course be missing the likely desired capability of completing packages to install. And we can see from the part of the manpage that we shared it takes command/action verbs as syntax, our completions generation script is only able to try to find things starting with -. So I don't really think there's much to hope for with that script.

Unless someone donates tlmgrcompletions to fish, there are unlikely to ever be tlmgr completions.

But if you want to debug why fish_generate_completions failed to grab --options from the man page, I guess it'd be useful if you shared more of it, with the actual OPTIONS section at play for example, and also the completions it generated from it in ~/.local/share/fish/generated_completions/tlmgr.fish. Keep in mind that it's a miracle completions are generated by fish from manpages - but it's not a method that produces good completions.

@feigaoxyz
Copy link
Author

Yes, I am talking about grabbing options from man page.

I post the raw man page tlmgr.1 and first 1000 lines of man tlmgr to this gist.

Looks like it did have OPTIONS and -- prefixed options.

@krader1961
Copy link
Contributor

@feigaoxyz, We simply do not have the resources to write custom completions for every command. We rely on users like yourself to create completion scripts for their favorite command and submit them to us for merging into the fish project. Also, the auto-generated completions from man pages will never work much better than they do now unless someone like yourself improves the code.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 18, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants