René's URL Explorer Experiment


Title: CLI args/config file refactoring · Issue #897 · scriptcs/scriptcs · GitHub

Open Graph Title: CLI args/config file refactoring · Issue #897 · scriptcs/scriptcs

X Title: CLI args/config file refactoring · Issue #897 · scriptcs/scriptcs

Description: IMO this whole space is currently quite confusing and clunky. After spending time on #896 I started to think about an alternative approach. Here's what I've come up with so far: Splitting of the CLI args into command args and script args...

Open Graph Description: IMO this whole space is currently quite confusing and clunky. After spending time on #896 I started to think about an alternative approach. Here's what I've come up with so far: Splitting of the CL...

X Description: IMO this whole space is currently quite confusing and clunky. After spending time on #896 I started to think about an alternative approach. Here's what I've come up with so far: Splitting o...

Opengraph URL: https://github.com/scriptcs/scriptcs/issues/897

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"CLI args/config file refactoring","articleBody":"IMO this whole space is currently quite confusing and clunky. After spending time on https://github.com/scriptcs/scriptcs/pull/896 I started to think about an alternative approach. Here's what I've come up with so far:\n1. Splitting of the CLI args into command args and script args is lifted up to `Program.Main`. I think this can be re-written trivially so it won't be necessary to encapsulate it in a type. It's really a `Program.Main` level operation.\n2. Parsing of the command args into `ScriptCsArgs` is lifted up to `Program.Main`. Normally this is a simple call to `PowerArgs` but since this also has to do some gymnastics regarding `-install` which has two optional parameters, package name and version (something which I think is not natively supported by PowerArgs), this is probably best encapsulated in a `ScriptCsArgsFactory`. If `ScriptCsArgsFactory` throws an exception, `Program.Main` writes the exception message to the console, shows usage and then exits with code 1 (as currently implemented in #896)\n3. If `ScriptCsArgs.Version` or `ScriptCsArgs.Help` are `true`, `Program.Main` either shows the version or displays usage respectively and exits with code 0. This removes the need for `VersionCommand` and `ShowUsageCommand` which, IMO, are not commands, they are just options to show metadata without actually performing a command. This fits the behaviour of other platforms, e.g. node. For more on that, see https://github.com/scriptcs/scriptcs/issues/175#issuecomment-68596753\n4. We read and store the `Config` property from `ScriptCsArgs`\n5. We introduce a new type `ScriptCsConfig` and construct an instance using `ScriptCsArgs`. This can be encapsulated in a `ScriptCsConfigFactory` if required\n\nOnce these steps have been completed, the concept of 'arguments' no longer exists (disregarding the script args which need to be passed all the way through). We only have to think about rehydrating `ScriptCsConfig` instances from the local and global config files and then performing a masking operation: commandLineScriptCsConfig + localScriptCsConfig + globalScriptCsConfig. All properties on `ScriptCsConfig` should be nullable so for each property we take the first non-null value, falling back to a default.\n\nWe then pass the final `ScriptCsConfig` instance, along with the script args, to `CommandFactory` and the rest of the code remains as is.\n","author":{"url":"https://github.com/adamralph","@type":"Person","name":"adamralph"},"datePublished":"2015-01-08T11:07:17Z","url":"https://github.com/scriptcs/scriptcs/issues/897"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:85175182-384e-c935-178c-b7fcd2fa2aee
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idA380:157BA1:8FEEEF:C11FD8:6B00432D
html-safe-nonce047a533adffd0b1b48afb6500f3ff6fc77b0230dd962034eb11737b59a7f6180
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBMzgwOjE1N0JBMTo4RkVFRUY6QzExRkQ4OjZCMDA0MzJEIiwidmlzaXRvcl9pZCI6IjMzODI3NDI2ODM5NDM0NTM0ODUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmaca898a6b85c71ae23d49430e32f5fc13f96695d9aa3216e25db9078a1990f2955
hovercard-subject-tagissue:53739045
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/scriptcs/scriptcs/897/issue_layout
twitter:imagehttps://opengraph.githubassets.com/0861a69d455de953fed1e90e878f236d2c7cfe3d523c966955a38a38928d9566/scriptcs/scriptcs/issues/897
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/0861a69d455de953fed1e90e878f236d2c7cfe3d523c966955a38a38928d9566/scriptcs/scriptcs/issues/897
og:image:altIMO this whole space is currently quite confusing and clunky. After spending time on #896 I started to think about an alternative approach. Here's what I've come up with so far: Splitting of the CL...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameadamralph
hostnamegithub.com
expected-hostnamegithub.com
None7d0829bbde9e48b2486cb5dd6d147896eb01d32134627091f818958a935ef3f0
turbo-cache-controlno-preview
go-importgithub.com/scriptcs/scriptcs git https://github.com/scriptcs/scriptcs.git
octolytics-dimension-user_id3758046
octolytics-dimension-user_loginscriptcs
octolytics-dimension-repository_id8473240
octolytics-dimension-repository_nwoscriptcs/scriptcs
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id8473240
octolytics-dimension-repository_network_root_nwoscriptcs/scriptcs
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releasef3f3a43ca095cdea3abbb394112e971f9fdb94fa
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/scriptcs/scriptcs/issues/897#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fscriptcs%2Fscriptcs%2Fissues%2F897
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fscriptcs%2Fscriptcs%2Fissues%2F897
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=scriptcs%2Fscriptcs
Reloadhttps://github.com/scriptcs/scriptcs/issues/897
Reloadhttps://github.com/scriptcs/scriptcs/issues/897
Reloadhttps://github.com/scriptcs/scriptcs/issues/897
scriptcshttps://github.com/scriptcs
scriptcshttps://github.com/scriptcs/scriptcs
Codehttps://github.com/scriptcs/scriptcs
Issues167 (167)https://github.com/scriptcs/scriptcs/issues
Pull requests2 (2)https://github.com/scriptcs/scriptcs/pulls
Actionshttps://github.com/scriptcs/scriptcs/actions
Projectshttps://github.com/scriptcs/scriptcs/projects
Wikihttps://github.com/scriptcs/scriptcs/wiki
Security and qualityhttps://github.com/scriptcs/scriptcs/security
Insightshttps://github.com/scriptcs/scriptcs/insights
https://github.com/scriptcs/scriptcs
New issuehttps://github.com/login?return_to=https://github.com/scriptcs/scriptcs/issues/897
New issuehttps://github.com/login?return_to=https://github.com/scriptcs/scriptcs/issues/897
#944https://github.com/scriptcs/scriptcs/pull/944
CLI args/config file refactoringhttps://github.com/scriptcs/scriptcs/issues/897#top
#944https://github.com/scriptcs/scriptcs/pull/944
https://github.com/adamralph
refactoringhttps://github.com/scriptcs/scriptcs/issues?q=state%3Aopen%20label%3A%22refactoring%22
v0.15https://github.com/scriptcs/scriptcs/milestone/19
https://github.com/adamralph
adamralphhttps://github.com/adamralph
on Jan 8, 2015https://github.com/scriptcs/scriptcs/issues/897#issue-53739045
#896https://github.com/scriptcs/scriptcs/pull/896
implemented CommandLine.UnexpectedOption #896https://github.com/scriptcs/scriptcs/pull/896
Consider refactoring our arg design to use sub commands #175 (comment)https://github.com/scriptcs/scriptcs/issues/175#issuecomment-68596753
adamralphhttps://github.com/adamralph
refactoringhttps://github.com/scriptcs/scriptcs/issues?q=state%3Aopen%20label%3A%22refactoring%22
on Jan 8, 2015https://github.com/scriptcs/scriptcs/issues/897#event-215834029
adamralphhttps://github.com/adamralph
on Feb 6, 2015https://github.com/scriptcs/scriptcs/issues/897#event-231447819
glennblockhttps://github.com/glennblock
completedhttps://github.com/scriptcs/scriptcs/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
#944https://github.com/scriptcs/scriptcs/pull/944
on Mar 27, 2015https://github.com/scriptcs/scriptcs/issues/897#event-266921747
glennblockhttps://github.com/glennblock
on Mar 27, 2015https://github.com/scriptcs/scriptcs/issues/897#event-266921776
Merge pull request #944 from adamralph/897https://github.com/scriptcs/scriptcs/commit/d9e042cb159647c917945ba0bd4eb1ead9cf3561
#944https://github.com/scriptcs/scriptcs/pull/944
d9e042chttps://github.com/scriptcs/scriptcs/commit/d9e042cb159647c917945ba0bd4eb1ead9cf3561
adamralphhttps://github.com/adamralph
v0.15https://github.com/scriptcs/scriptcs/milestone/19
on Mar 27, 2015https://github.com/scriptcs/scriptcs/issues/897#event-266923178
Sign up for freehttps://github.com/signup?return_to=https://github.com/scriptcs/scriptcs/issues/897
Sign in to commenthttps://github.com/login?return_to=https://github.com/scriptcs/scriptcs/issues/897
adamralphhttps://github.com/adamralph
refactoringhttps://github.com/scriptcs/scriptcs/issues?q=state%3Aopen%20label%3A%22refactoring%22
v0.15https://github.com/scriptcs/scriptcs/milestone/19
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.