dscottboggs / nu-completions

A failed experiment: Nushell "extern" definitions for tab completion generated from Fish's
GNU General Public License v3.0
9 stars 1 forks source link

new issue / old issue #3

Closed fdncred closed 1 year ago

fdncred commented 1 year ago

Seems to be failing

nu-completion-script ~/.local/share/fish/generated_completions/*.fish                                                           18446  02:38:35 PM
{"level":50,"time":1677616732945,"msg":"error parsing shell words","line":"complete -c aptitude-curses -l 'show-summary"}
{"level":50,"time":1677616732945,"msg":"failed to process completions at \"../../.local/share/fish/generated_completions/aptitude-curses.fish\": missing closing quote"}
{"level":50,"time":1677616732946,"msg":"error parsing shell words","line":"complete -c aptitude -l 'show-summary"}
{"level":50,"time":1677616732946,"msg":"failed to process completions at \"../../.local/share/fish/generated_completions/aptitude.fish\": missing closing quote"}
{"level":50,"time":1677616735843,"msg":"error patching","source":"/home/fdncred/.config/nushell/completions/definitions/capsh.nu","patch":"/home/fdncred/.config/nushell/completions/patches/capsh.patch","patch_output":"patching file /home/fdncred/.config/nushell/completions/definitions/capsh.nu\nHunk #1 FAILED at 39.\n1 out of 1 hunk FAILED -- saving rejects to file /home/fdncred/.config/nushell/completions/definitions/capsh.nu.rej\n","status":1}
Error: process exited unsuccessfully: exit status: 1
fdncred commented 1 year ago

For fun, I opened the capsh.fish. This is what mine looks like

# capsh
# Autogenerated from man page /usr/share/man/man1/capsh.1.gz
complete -c capsh -l help -d 'Display the list of commands supported by  capsh '
complete -c capsh -l print -d 'Display prevailing capability and related state'
complete -c capsh -l caps -d 'Set the prevailing process capabilities to those specified by R cap-set '
complete -c capsh -l drop -d 'Remove the listed capabilities from the prevailing bounding set'
complete -c capsh -l inh -d 'Set the inheritable set of capabilities for the current process to equal thos…'
complete -c capsh -l user -d 'Assume the identity of the named user'
complete -c capsh -l modes -d 'Lists all of the libcap modes supported by  --mode '
complete -c capsh -l mode -d 'Force the program into a  cap_set_mode (3) security mode'
complete -c capsh -l inmode -d 'Confirm that the prevailing mode is that specified in R <mode> , or exit with…'
complete -c capsh -l uid -d 'Force all UID values to equal  id using the  setuid (2) system call'
complete -c capsh -l cap-uid -d 'use the  cap_setuid (3) function to set the UID of the current process'
complete -c capsh -l is-uid -d 'Exit with status 1 unless the current UID equals R <id> '
complete -c capsh -l gid -d 'Force all GID values to equal  id using the  setgid (2) system call'
complete -c capsh -l is-gid -d 'Exit with status 1 unless the current GIQ equals R <id> '
complete -c capsh -l groups -d 'Set the supplementary groups to the numerical list provided'
complete -c capsh -l keep -d 'In a non-pure capability mode, the kernel provides liberal privilege to the s…'
complete -c capsh -l secbits -d 'Set the security-bits for the program'
complete -c capsh -l chroot -d 'Execute the  chroot (2) system call with the new root-directory (/) equal to …'
complete -c capsh -l forkfor -d 'This command causes the program to fork a child process for so many seconds'
complete -c capsh -l killit -d 'This commands causes a  --forkfor child to be  kill (2)d with the specified s…'
complete -c capsh -l decode -d 'This is a convenience feature'
complete -c capsh -l supports -d 'As the kernel evolves, more capabilities are added'
complete -c capsh -l has-p -d 'Exit with status 1 unless the  permitted vector has capability  xxx raised'
complete -c capsh -l has-ambient -d 'Performs a check to see if the running kernel supports ambient capabilities'
complete -c capsh -l has-a -d 'Exit with status 1 unless the  ambient vector has capability  xxx raised'
complete -c capsh -l addamb -d 'Adds the specified ambient capability to the running process'
complete -c capsh -l delamb -d 'Removes the specified ambient capability from the running process'
complete -c capsh -s c -d 'for specific commands'
complete -c capsh -l noamb -d 'Drops all ambient capabilities from the running process'
fdncred commented 1 year ago

I move capsh.fish out and then it failed on aptitude.fish and aptitude-curses.fish. Here's what aptitude.fish looks like. Kind of looks like a fish bug here.

# aptitude
# Autogenerated from man page /usr/share/man/man8/aptitude.8.gz
complete -c aptitude -l add-user-tag -d 'For full-upgrade, safe-upgrade, forbid-version, hold, install, keep-all, mark…'
complete -c aptitude -l add-user-tag-to -d 'For full-upgrade, safe-upgrade, forbid-version, hold, install, keep-all, mark…'
complete -c aptitude -l allow-new-upgrades -d 'When the safe resolver is being used (i. e'
complete -c aptitude -l allow-new-installs -d 'Allow the safe-upgrade command to install new packages; when the safe resolve…'
complete -c aptitude -l allow-untrusted -d 'Install packages from untrusted sources without prompting'
complete -c aptitude -l disable-columns -d 'This option causes aptitude search and aptitude versions to output their resu…'
complete -c aptitude -s D -l show-deps -d 'For commands that will install or remove packages (install, full-upgrade, etc…'
complete -c aptitude -s d -l download-only -d 'Download packages to the package cache as necessary, but do not install or re…'
complete -c aptitude -s F -l display-format -d 'Specify the format which should be used to display output from the search and…'
complete -c aptitude -s f -d 'Try hard to fix the dependencies of broken packages, even if it means ignorin…'
complete -c aptitude -l full-resolver -d 'When package dependency problems are encountered, use the default \\(lqfull\\(r…'
complete -c aptitude -l group-by -d 'Control how the versions command groups its output'
complete -c aptitude -s h -l help -d 'Display a brief help message.  Identical to the help action'
complete -c aptitude -l log-file -d 'If <file> is a nonempty string, log messages will be written to it, except th…'
complete -c aptitude -l log-level -l log-level -d '--log-level=<level> causes aptitude to only log messages whose level is <leve…'
complete -c aptitude -l log-resolver -d 'Set some standard log levels related to the resolver, to produce logging outp…'
complete -c aptitude -l no-new-installs -d 'Prevent safe-upgrade from installing any new packages; when the safe resolver…'
complete -c aptitude -l no-new-upgrades -d 'When the safe resolver is being used (i. e'
complete -c aptitude -l no-show-resolver-actions -d 'Do not display the actions performed by the \\(lqsafe\\(rq resolver, overriding…'
complete -c aptitude -s O -l sort -d 'Specify the order in which output from the search and versions commands shoul…'
complete -c aptitude -s o -d 'Set a configuration file option directly; for instance, use -o Aptitude::Log=…'
complete -c aptitude -s P -l prompt -d 'Always display a prompt before downloading, installing or removing packages, …'
complete -c aptitude -l purge-unused -d 'If Aptitude::Delete-Unused is set to \\(lqtrue\\(rq (its default), then in addi…'
complete -c aptitude -s q -l quiet -d 'Suppress all incremental progress indicators, thus making the output loggable'
complete -c aptitude -s R -l without-recommends -d 'Do not treat recommendations as dependencies when installing new packages (th…'
complete -c aptitude -s r -l with-recommends -d 'Treat recommendations as dependencies when installing new packages (this over…'
complete -c aptitude -l remove-user-tag -d 'For full-upgrade, safe-upgrade forbid-version, hold, install, keep-all, marka…'
complete -c aptitude -l remove-user-tag-from -d 'For full-upgrade, safe-upgrade forbid-version, hold, install, keep-all, marka…'
complete -c aptitude -s s -l simulate -d 'In command-line mode, print the actions that would normally be performed, but…'
complete -c aptitude -l safe-resolver -d 'When package dependency problems are encountered, use a \\(lqsafe\\(rq algorith…'
complete -c aptitude -l schedule-only -d 'For commands that modify package states, schedule operations to be performed …'
complete -c aptitude -l show-package-names -d 'Controls when the versions command shows package names'
complete -c aptitude -l show-resolver-actions -d 'Display the actions performed by the \\(lqsafe\\(rq resolver and by safe-upgrade'
complete -c aptitude -l show-summary -d 'Changes the behavior of \\(lqaptitude why\\(rq to summarize each dependency cha…'
complete -c aptitude -l 'show-summary
--show-summary
used' -d '\\} '
complete -c aptitude -s t -l target-release -d 'Set the release from which packages should be installed'
complete -c aptitude -s V -l show-versions -d 'Show which versions of packages will be installed'
complete -c aptitude -s v -l verbose -d 'Causes some commands (for instance, show) to display extra information'
complete -c aptitude -l version -d 'Display the version of aptitude and some information about how it was compiled'
complete -c aptitude -l visual-preview -d 'When installing or removing packages from the command line, instead of displa…'
complete -c aptitude -s W -l show-why -d 'In the preview displayed before packages are installed or removed, show which…'
complete -c aptitude -s w -l width -d 'Specify the display width which should be used for output from the search and…'
complete -c aptitude -s y -l assume-yes -d 'When a yes/no prompt would be presented, assume that the user entered \\(lqyes…'
complete -c aptitude -s Z -d 'Show how much disk space will be used or freed by the individual packages bei…'
complete -c aptitude -l autoclean-on-startup -d 'Deletes old downloaded files when the program starts (equivalent to starting …'
complete -c aptitude -l clean-on-startup -d 'Cleans the package cache when the program starts (equivalent to starting the …'
complete -c aptitude -s i -d 'Displays a download preview when the program starts (equivalent to starting t…'
complete -c aptitude -s S -d 'Loads the extended state information from <fname> instead of the standard sta…'
complete -c aptitude -s u -d 'Begins updating the package lists as soon as the program starts'
complete -c aptitude -l arch-only -d 'is present, only architecture-dependent build dependencies (i. e'

Once I moved those 3 fish files out, it ran successfully.

dscottboggs commented 1 year ago

This looks like it's doing what it's supposed to -- patching everything it can and then showing an error at the end if any were encountered. Nothing happens after that so this makes sense.

These issues...especially the aptitude one, are why we need the patches, and the thing where capsh is failing is why I think the patches won't work.