Unknown flag is not treated as uknown #124

Closed
opened 2018-03-13 14:36:15 +00:00 by philm · 8 comments
philm commented 2018-03-13 14:36:15 +00:00 (Migrated from gitlab2.manjaro.org)

Created by: petsam

Running pacman-mirrors -G the script updated mirrors in /etc/pacman.d/mirrorlist

$ sudo pacman-mirrors -G
.: INFO Downloading mirrors from repo.manjaro.org
.: INFO Using custom mirror file
.: INFO Querying mirrors - This may take some time
   0.398 Bulgaria       : http://manjaro.telecoms.bg/
   0.530 Bulgaria       : https://mirrors.netix.net/manjaro/
   0.626 Denmark        : https://www.uex.dk/public/manjaro/
   0.248 France         : http://kibo.remi.lu/
   0.500 France         : https://fr.mirror.babylon.network/manjaro/
   0.264 Germany        : http://mirror.ragenetwork.de/manjaro/
   0.471 Germany        : https://mirror.alpix.eu/manjaro/
   0.904 Germany        : https://mirror.netzspielplatz.de/manjaro/packages/
   0.516 Netherlands    : https://nl.mirror.babylon.network/manjaro/
   0.269 United_Kingdom : http://manjaro.mirrors.uk2.net/
   0.286 United_Kingdom : http://mirror.catn.com/pub/manjaro/
   0.462 United_Kingdom : https://www.mirrorservice.org/sites/repo.manjaro.org/repos/
   0.968 United_Kingdom : http://repo.manjaro.org.uk/
   0.935 United_States  : https://mirror.math.princeton.edu/pub/manjaro/
.: INFO Writing mirror list
   France          : http://kibo.remi.lu/testing/$repo/$arch
   Germany         : http://mirror.ragenetwork.de/manjaro/testing/$repo/$arch
   United_Kingdom  : http://manjaro.mirrors.uk2.net/testing/$repo/$arch
   United_Kingdom  : http://mirror.catn.com/pub/manjaro/testing/$repo/$arch
   Bulgaria        : http://manjaro.telecoms.bg/testing/$repo/$arch
   United_Kingdom  : https://www.mirrorservice.org/sites/repo.manjaro.org/repos/testing/$repo/$arch
   Germany         : https://mirror.alpix.eu/manjaro/testing/$repo/$arch
   France          : https://fr.mirror.babylon.network/manjaro/testing/$repo/$arch
   Netherlands     : https://nl.mirror.babylon.network/manjaro/testing/$repo/$arch
   Bulgaria        : https://mirrors.netix.net/manjaro/testing/$repo/$arch
   Denmark         : https://www.uex.dk/public/manjaro/testing/$repo/$arch
   Germany         : https://mirror.netzspielplatz.de/manjaro/packages/testing/$repo/$arch
   United_States   : https://mirror.math.princeton.edu/pub/manjaro/testing/$repo/$arch
   United_Kingdom  : http://repo.manjaro.org.uk/testing/$repo/$arch
.: INFO Mirror list generated and saved to: /etc/pacman.d/mirrorlist
.: INFO To remove custom config run  'sudo pacman-mirrors -c all'

Expected behavior should be an info/error message about uknown flag. I did not want my mirrorlist affected, since I manually handle it.

*Created by: petsam* Running `pacman-mirrors -G` the script updated mirrors in `/etc/pacman.d/mirrorlist` ``` $ sudo pacman-mirrors -G .: INFO Downloading mirrors from repo.manjaro.org .: INFO Using custom mirror file .: INFO Querying mirrors - This may take some time 0.398 Bulgaria : http://manjaro.telecoms.bg/ 0.530 Bulgaria : https://mirrors.netix.net/manjaro/ 0.626 Denmark : https://www.uex.dk/public/manjaro/ 0.248 France : http://kibo.remi.lu/ 0.500 France : https://fr.mirror.babylon.network/manjaro/ 0.264 Germany : http://mirror.ragenetwork.de/manjaro/ 0.471 Germany : https://mirror.alpix.eu/manjaro/ 0.904 Germany : https://mirror.netzspielplatz.de/manjaro/packages/ 0.516 Netherlands : https://nl.mirror.babylon.network/manjaro/ 0.269 United_Kingdom : http://manjaro.mirrors.uk2.net/ 0.286 United_Kingdom : http://mirror.catn.com/pub/manjaro/ 0.462 United_Kingdom : https://www.mirrorservice.org/sites/repo.manjaro.org/repos/ 0.968 United_Kingdom : http://repo.manjaro.org.uk/ 0.935 United_States : https://mirror.math.princeton.edu/pub/manjaro/ .: INFO Writing mirror list France : http://kibo.remi.lu/testing/$repo/$arch Germany : http://mirror.ragenetwork.de/manjaro/testing/$repo/$arch United_Kingdom : http://manjaro.mirrors.uk2.net/testing/$repo/$arch United_Kingdom : http://mirror.catn.com/pub/manjaro/testing/$repo/$arch Bulgaria : http://manjaro.telecoms.bg/testing/$repo/$arch United_Kingdom : https://www.mirrorservice.org/sites/repo.manjaro.org/repos/testing/$repo/$arch Germany : https://mirror.alpix.eu/manjaro/testing/$repo/$arch France : https://fr.mirror.babylon.network/manjaro/testing/$repo/$arch Netherlands : https://nl.mirror.babylon.network/manjaro/testing/$repo/$arch Bulgaria : https://mirrors.netix.net/manjaro/testing/$repo/$arch Denmark : https://www.uex.dk/public/manjaro/testing/$repo/$arch Germany : https://mirror.netzspielplatz.de/manjaro/packages/testing/$repo/$arch United_States : https://mirror.math.princeton.edu/pub/manjaro/testing/$repo/$arch United_Kingdom : http://repo.manjaro.org.uk/testing/$repo/$arch .: INFO Mirror list generated and saved to: /etc/pacman.d/mirrorlist .: INFO To remove custom config run 'sudo pacman-mirrors -c all' ``` Expected behavior should be an info/error message about uknown flag. I did not want my mirrorlist affected, since I manually handle it.
philm commented 2018-03-19 06:52:29 +00:00 (Migrated from gitlab2.manjaro.org)

Created by: fhdk

-G is not an unknown argument/flag - it is an API argument and as such it does not work if -a/--api is missing.

It is documented in https://github.com/manjaro/pacman-mirrors/blob/master/docs/index.md in GENERAL INFO ABOUT ARGUMENTS section

Some arguments requires another argument present to have effect.

and

API specific arguments. For those to have effect the -a/--api argument must be present.

and in the API section

-G, --get-branch : Return branch from configuration.

*Created by: fhdk* `-G` is not an unknown argument/flag - it is an API argument and as such it does not work if `-a/--api` is missing. It is documented in https://github.com/manjaro/pacman-mirrors/blob/master/docs/index.md in **GENERAL INFO ABOUT ARGUMENTS** section >Some arguments requires another argument present to have effect. and >API specific arguments. For those to have effect the -a/--api argument must be present. and in the **API** section >-G, --get-branch : Return branch from configuration.
philm commented 2018-03-19 09:11:34 +00:00 (Migrated from gitlab2.manjaro.org)

Created by: petsam

The expected behavior would be to… what in your opinion?
If the script understands the args, do a refresh mirrors action? Is this at least documented?

Please, don't close the issues before at least get some more response. It is not nice.

*Created by: petsam* The expected behavior would be to… what in your opinion? If the script understands the args, do a refresh mirrors action? Is this at least documented? Please, don't close the issues before at least get some more response. It is not nice.
philm commented 2018-03-19 10:06:25 +00:00 (Migrated from gitlab2.manjaro.org)

Created by: fhdk

  • -G it is a documented as belonging to the API group
  • It is documented, if --api is not supplied then any API argument present will be ignored.
  • Normal behavior when one or more arguments is present is to parse the arguments and - unless --no-mirrorlist is specified - to create a mirror list.
  • In the usage overview -h, all API arguments is clearly marked with API

Since the subject of the issue is claiming the -G argument is unknown and undocumented then the issue is not an issue and can be closed when the solution is presented.

We do not need a lengthy debate whether it is documented or not since it is, and the behavior is expected.

Also have look at issue #126 and issue #125

*Created by: fhdk* * `-G` it is a documented as belonging to the `API` group * It is documented, if `--api` is not supplied then any API argument present will be ignored. * Normal behavior when one or more arguments is present is to parse the arguments and - unless `--no-mirrorlist` is specified - to create a mirror list. * In the usage overview `-h`, all API arguments is clearly marked with **API** Since the subject of the issue is claiming the -G argument is unknown and undocumented then the issue is not an issue and can be closed when the solution is presented. We do not need a lengthy debate whether it is documented or not since it is, and the behavior is expected. Also have look at issue #126 and issue #125
philm commented 2018-03-19 10:13:40 +00:00 (Migrated from gitlab2.manjaro.org)

Created by: fhdk

Duplicate - see #125

*Created by: fhdk* Duplicate - see #125
philm commented 2018-03-19 10:28:03 +00:00 (Migrated from gitlab2.manjaro.org)

Created by: petsam

From man pacman-mirrrors

  > If no arguments are given pacman-mirrors lists available options.

Which you say it is not exactly right.

Normal behavior when one or more arguments is present is to parse the arguments and - unless --no-mirrorlist is specified - to create a mirror list.

I thought feedback was welcome.
Sorry.
Have a nice flight.

*Created by: petsam* From `man pacman-mirrrors` > If no arguments are given pacman-mirrors lists available options. Which you say it is not exactly right. > Normal behavior when one or more arguments is present is to parse the arguments and - unless --no-mirrorlist is specified - to create a mirror list. I thought feedback was welcome. Sorry. Have a nice flight.
philm commented 2018-03-19 10:31:09 +00:00 (Migrated from gitlab2.manjaro.org)

Created by: fhdk

If no arguments are given pacman-mirrors lists available options.

But an argument is given -G

And feedback are welcome.

*Created by: fhdk* > If no arguments are given pacman-mirrors lists available options. But an argument is given `-G` And feedback are welcome.
philm commented 2018-03-19 10:47:27 +00:00 (Migrated from gitlab2.manjaro.org)

Created by: petsam

But an argument is given -G

that is not handled correctly.
This is an issue, whether you close the issue, or not.

I have read half the code to understand as I can and very well read man page and help.
I have used the script and decided to not use it unless for testing.
Well done! There are no open issues on pacman-mirrors. That's a great achievment!

*Created by: petsam* > But an argument is given -G that is not handled correctly. This is an issue, whether you close the issue, or not. I have read half the code to understand as I can and very well read man page and help. I have used the script and decided to not use it unless for testing. Well done! There are no open issues on pacman-mirrors. That's a great achievment!
philm commented 2018-03-19 12:51:38 +00:00 (Migrated from gitlab2.manjaro.org)
*Created by: fhdk* https://github.com/manjaro/pacman-mirrors/commit/5eda817fbc7362a30bf23b1913eaa78944b14ba7
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
applications/pacman-mirrors#124
No description provided.