iterative / shtab

↔️ Automagic shell tab completion for Python CLI applications
https://docs.iterative.ai/shtab
Other
375 stars 34 forks source link

Add cli option to specify program name #16

Closed hajs closed 4 years ago

hajs commented 4 years ago

Ofen my scripts do not contain parser = ArgumentParser(prog="somenone") and this will result in strange names in the generated complete script. This change adds an option for these situations.

casperdcl commented 4 years ago

why would someone avoid using prog=?

hajs commented 4 years ago

It is optional and people are lazy ;) So it seems quite common that this keyword is omitted: https://sourcegraph.com/search?q=ArgumentParser%28%29+lang:python+&patternType=literal

If I want to add bash completion to my scripts it it would be easy to add prog= but if a want to add completion to other people's programs I always would have to edit the generated script.

codecov-commenter commented 4 years ago

Codecov Report

Merging #16 into master will increase coverage by 1.42%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #16      +/-   ##
==========================================
+ Coverage   83.87%   85.29%   +1.42%     
==========================================
  Files           1        1              
  Lines          31       34       +3     
==========================================
+ Hits           26       29       +3     
  Misses          5        5              
Impacted Files Coverage Δ
shtab/main.py 85.29% <100.00%> (+1.42%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 34dfa38...5f72e7e. Read the comment docs.