Arguments accepted by the application

Have you tried following

@chipaca

snap run --command=complete abc.abcconfig 9 9 18 1 " " 'abc.abcconfig ’ abc.abcconfig “”

  • snap run --command=complete abc.abcconfig 9 9 18 1 ’ ’ 'abc.abcconfig ’ abc.abcconfig ‘’
    /usr/lib/snapd/etelpmoc.sh: строка 128: complete: abc.abcconfig: there is no example of completion

Maybe this is something like the implementation of the script?

_abcconfig()
{
    IFS=$'\n'
    COMPREPLY=()

#   echo "command=${COMP_WORDS[@]}"

    # Call abcconfig in Bash-completion mode and store result in 'completedArgs'
    completedArgs="$(ABC_BASH_COMPLETION=yes ${COMP_WORDS[@]} 2>&1)"
    completedArgs_result=$?
#   echo "completedArgs=${completedArgs}"
#   echo "completedArgs_result=${completedArgs_result}"

    # If argument completing was failed, exit
    if [[ ${completedArgs_result} -gt 0 ]]; then
        #echo "err"
        return 0
    fi

    # Return completed arguments as result in Bash
    IFS=$'\n' COMPREPLY=( $(echo "${completedArgs}") )
#   echo "COMPREPLY=${COMPREPLY[@]}"
    return 0
}

complete -F _abcconfig abcconfig

Maybe someone knows, maybe this problem will appear due to the implementation of the script itself?
And if the difference between veeamconfig and veeam.veeamconfig?
@chipaca Maybe you have some idea on this?

Sorry, I’m not sure what your question is.

The fact that you threw me above, the description for setting up bash_completion, it did not help me.
If you see in the file snapcraft.yaml, then you can see that the name of the package is abc, and then comes abcconfig.
When installing an application from the deb package, you need to write abcconfig, and in the case of a snap package, you need to wriye abc.abcconfig.
Could this affect the operation of bash_completion?
If yes, then how to correct the need to type the name of the package, and then the name of the application, and immediately write abcconfig?

Unless I’m misunderstadning, this is a question about veeam, not about snapd; I know nothing about veeam.

Rather, it’s about how snap works in such cases)

Is it possible to get rid of the need to type like this veeam.veeamconfig? That is, immediately type veeamconfig?
Maybe this is the whole problem.

Ah. I think I understand what you’re saying, and what you’re trying to ask, now.

The document I linked to is not a “fact”, it is a series of steps you can use to find the issue.

What were the results of each step? Which one failed?

In the evening I will go through the whole settings once again and write down what mistakes I saw.
Once again, to clarify, is it possible to access the application without entering the snap package name?

yes, we call them “aliases”, the user can create them by hand, and you can request automatic ones:

1 Like

This probably helps, as well: http://www.catb.org/~esr/faqs/smart-questions.html#beprecise

image

According to your advice, I went through the steps as described.
In 4 points in the console I got this log:

...
+ [[ 2 -ge 2 ]]
+ _complete_from_snap abc.absconfig '' abc.abcconfig
+ read -r -a opts
++ snap run --command=complete abc.abcconfig 9 9 19 1 ' 
"'\''><=;|&(:' ' abc.abcconfig ' abc.abcconfig ''
+ [[ 1 -gt 0 ]]
+ [[ filenames == \c\a\n\n\o\t ]]
+ for i in "${opts[@]}"
+ [[ filenames =~ ^[a-z]+$ ]]
+ read -r bounced
+ case "$bounced" in
+ read -r sep
+ '[' -n '' ']'
...

snap run --command=complete abc.abcconfig 9 9 19 1 " " 'abc.abcconfig ' abc.abcconfig ""
/usr/lib/snapd/etelpmoc.sh: line 128: complete: abc.abcconfig: no completion specification
filenames

commands
dev
etc
lib
lib64
meta
run
sbin
snap
usr
var
command-abc.wrapper
command-abcconfig.wrapper
command-abcservice.wrapper
commands
dev
etc
lib
lib64
meta
run
sbin
snap
stop-command-abcservice.wrapper
usr
var

Where else can I looking for reason that this functionality does not work in the snap package?
Thx.

From the text in step 4,

so, does your completion snippet set up a completer for your unaliased snap.app command?

Double tapping the TAB key does not supplement the arguments.
(This works if the application is installed from the deb package.)

But, if I enter arguments from memory, then it works.

It appears that the completion rules doesn’t cover the unaliased snap launch command (_snap_name_._app_name_), that’s why it won’t work.

You have to implement one and patch it into the providing part.

When I did an alias from abc.abcconfig to abcconfig, after I did

source /usr/share/bash-completion/bash_completion
source my-completer.sh

arguments began to be displayed.
It worked.
But when I restarted the computer, it stopped working.
Please explain what is wrong with this snap functionality that it works so strangely?

That’s because the source command only take effect in the current shell session, you have to incorporate it with snapd’s bash completion integration and let it do it for you.

Well, I understand you. I’ll try to figure it out today.
But tell me, this is how I understand it should work right after installing the snap package, why it does not work like that?
Or is this functionality not completed yet?