KSP-CKAN / CKAN

The Comprehensive Kerbal Archive Network
https://forum.kerbalspaceprogram.com/index.php?/topic/197082-*
Other
1.98k stars 347 forks source link

[Feature] Command Line: add user customizable command line defaults for flags #3063

Open lamont-granquist opened 4 years ago

lamont-granquist commented 4 years ago

Problem

I'm really tired of adding --no-recommends to every single ckan install line. Occasionally I typo it. Sometimes I forget it when I don't actually mean to:

40341  ckan install RealSolarSystem --no-recommends
40342  ckan install RealismOverhaul --no-recommends
40343  ckan install ClickThroughBlocker --no-recommends
40344  ckan install ContractConfigurator --no-recommends
40346  ckan install CustomBarnKit-RO --no-recommends
40347  ckan install DeadlyReentryContinued --no-recommends
40349  ckan install DeadlyReentry --no-recommends
40351  ckan install DMagicOrbitalScience --no-recommends
40352  ckan install DMModuleScienceAnimateGeneric --no-recommends
40354  ckan install DMagicScienceAnimate --no-recommends
40355  ckan install Firesplittercore --no-recommends
40356  ckan install FiresplitterCore --no-recommends
40360  ckan install FirespitterCore FirespitterResourcesConfig --no-recommends
40362  ckan install KerbalConstructionTime-173 --no-recommends
40363  ckan install MagiCore --norecommends
40364  ckan install MagiCore --norecommends
40365  ckan install MagiCore --no-recommends
40367  ckan install RetractableLiftingSurface --no-recommends
40372  ckan install VenStockRevamp VenStockRevamp-Core VenStockRevamp-NewParts --no-recommends
40423  ckan install RSSDateTimeFormatter --no-recommends
40425  ckan install SemiSaturatableRW --no-recommends
40427  ckan install PersistentRotation --no-recommends
40428  ckan install KRASH --no-recommends
40438  ckan install ProceduralParts-Textures-SaturnNova MainSailorTextures-Complete VensStylePPTextures HazardTanksTextures FreedomTex BasicProceduralTextures ProceduralParts-Textures-SCCKSCS --no-recommends
40440  ckan install B9-PWings-Fork --no-recommends
40442  ckan install ProceduralFairings ProceduralFairings-ForEverything --no-recommends
40443  ckan install ROTanks --no-recommends
40444  ckan install ROCapsules --no-recommends
40445  ckan install ROEngines --no-recommends
40446  ckan install RealAntennas --no-recommends
40448  ckan install Kerbalism Kerbalism-Config-RO --no-recommends
40457  ckan install KSCSwitcher --no-recommends
40473  ckan install SCANSat --no-recommends
40474  ckan install RealEngines
40477  ckan install BluedogDB --no-recommends
40478  ckan install Taerobee --no-recommends
40480  ckan install ForgottenRealEngines --no-recommends
40483  ckan install realscaleboosters --no-recommends
40486  ckan install ProbesPlus --no-recommends
40487  ckan install hullcam --no-recommends
40490  ckan install HullcamVDSContinued --no-recommends
40492  ckan install InternalRCS --no-recommends
40493  ckan install kerbalalarmclock --no-recommends
40494  ckan install kerbalrenamer --no-recommends
40496  ckan install hangarextender --no-recommends
40499  ckan install HangerExtenderExtended --no-recommends
40500  ckan install JanitorsCloset --no-recommends
40503  ckan install KVVContinued --no-recommends
40508  ckan install RCSBuildAidCont --no-recommends
40521  ckan install ShipManifest --no-recommends
40522  ckan install WarpEverywhere --no-recommends
40524  ckan install EditorExtensionsRedux --no-recommends
40525  ckan install BetterBurnTime --no-recommends
40527  ckan install AECS-Motion-Suppressor --no-recommends
40529  ckan install NavballDockAlignIndCE --no-recommends
40565  ckan install MechJeb2-dev --no-recommends
40617  ckan install SPEngine --no-recommends

Suggestions

I really don't ever want this, and would like a way to set it being the default. That might mean that --recommends should be implemented (if its not already) as a way to override the false default on a case-by-case basis. As you can see, though, I actually never use anything other than --no-recommends except entirely by mistake, so I certainly could use a way to set the default to --no-recommends even if there was no way to override it short of unsetting that default (really, I'll just go research the recommended mods and install them one by one assuming I want them or not).

HebaruSan commented 4 years ago

If you're on a Unix (I assume those numbers are from your history command), an alias is a handy way to customize commands:

$ alias cki='ckan install --no-recommends'
$ cki KRASH
About to install...

 * KRASH - Kerbal Ramification Artifical Simulation Hub (simulation mod for KSP) 0.5.32 (spacedock.info, 104.2 KiB)
 * Toolbar Controller 1:0.1.9.4 (cached)
 * ClickThrough Blocker 0.1.9.5 (cached)
 * Zero MiniAVC 1:1.1.0.1 (cached)

Continue? [Y/n] 
lamont-granquist commented 4 years ago

not wild about that exact solution since i type fast enough that i'd prefer API consistency (everything prefixed by 'ckan') and i don't want to invent my own entire abbreviated api language (my typing speed >> my memory), but i supposed i can write a wrapper script that inspects argv[1] and manipulates it.