8000
Skip to content

Conversation

@classabbyamp
Copy link
Member

I can never remember which retval means which thing. This only prints if -v/--verbose is specified.

Examples:

$ ./bin/xbps-uhelper/xbps-uhelper -v cmpver 1 2 ; echo ret: $?
1 < 2
ret: 255
$ ./bin/xbps-uhelper/xbps-uhelper -v cmpver 1 1 ; echo ret: $?
1 = 1
ret: 0
$ ./bin/xbps-uhelper/xbps-uhelper -v cmpver 2 1 ; echo ret: $?
2 > 1
ret: 1
$ ./bin/xbps-uhelper/xbps-uhelper -v pkgmatch 'foo-1.0_1' 'foo>=0' ; echo ret: $?
foo-1.0_1 matches foo>=0
ret: 1
$ ./bin/xbps-uhelper/xbps-uhelper -v pkgmatch 'foo-1.0_1' 'foo<0.1_1' ; echo ret: $?
foo-1.0_1 does not match foo<0.1_1
ret: 0

it also seems that getting an error from pkgmatch is currently impossible

@leahneukirchen
Copy link
Member

useful!

Copy link
Member
@Chocimier Chocimier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, can you add completion too?

diff --git a/data/_xbps b/data/_xbps
index 31587571..6b5e3153 100644
--- a/data/_xbps
+++ b/data/_xbps
@@ -232,6 +232,7 @@ _xbps_uhelper() {
                {-C,--config=-}'[Full path to configuration file]:config file:_files' \
                {-d,--debug}'[Debug mode shown to stderr]' \
                {-r,--rootdir=-}'[Full path to rootdir]:root dir:_files -/' \
+               {-v,--verbose}'[Verbose messages]' \
                {-V,--version}'[Show XBPS version]' \
                '1:action:->actions' \
                '*:: :->args' && ret=0

@classabbyamp
Copy link
Member Author

Nice, can you add completion too?

ope forgot that, done (in a better way i think)

@classabbyamp
Copy link
Member Author

I've fixed that CI failure in f117b1f

@Duncaen
Copy link
Member
Duncaen commented May 30, 2023

What about printing this to stderr instead of stdout?

@classabbyamp
Copy link
Member Author

yes good idea

-->

@classabbyamp classabbyamp force-pushed the uhelper-verbose branch 2 times, most recently from 38facaf to 43e5a7f Compare June 1, 2023 18:15
I can never remember which retval means which thing. This only prints if
-v/--verbose is specified.

Examples:
```
$ ./bin/xbps-uhelper/xbps-uhelper -v cmpver 1 2 ; echo ret: $?
1 < 2
ret: 255
$ ./bin/xbps-uhelper/xbps-uhelper -v cmpver 1 1 ; echo ret: $?
1 = 1
ret: 0
$ ./bin/xbps-uhelper/xbps-uhelper -v cmpver 2 1 ; echo ret: $?
2 > 1
ret: 1
$ ./bin/xbps-uhelper/xbps-uhelper -v pkgmatch 'foo-1.0_1' 'foo>=0' ; echo ret: $?
foo-1.0_1 matches foo>=0
ret: 1
$ ./bin/xbps-uhelper/xbps-uhelper -v pkgmatch 'foo-1.0_1' 'foo<0.1_1' ; echo ret: $?
foo-1.0_1 does not match foo<0.1_1
ret: 0
```

it also seems that getting an error from pkgmatch is currently impossible
@Duncaen Duncaen merged commit 50fb201 into void-linux:master Jun 1, 2023
@classabbyamp classabbyamp deleted the uhelper-verbose branch June 1, 2023 18:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

0