Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New CLI #547

Open
wants to merge 37 commits into
base: v3
Choose a base branch
from
Open

New CLI #547

wants to merge 37 commits into from

Conversation

buddhikac96
Copy link
Contributor

@buddhikac96 buddhikac96 commented Jun 16, 2020

Windows Service Wrapper will update for YAML Configuration support as a part o GSoC 2020. So user need to to explicitly specify the configuration file on startup. Old CLI was in only commands manner and new CLI update to Commands and Options manner. User can specify config file, skip schema validation etc with WinSW commands such as install, start etc.

@buddhikac96 buddhikac96 changed the title Command line test Update CLI Jun 17, 2020
@buddhikac96 buddhikac96 changed the title Update CLI Update CLI (GSoC - 2020) Jun 17, 2020
@nxtn nxtn added the gsoc In the scope for Google Summer of Code label Jun 25, 2020
@nxtn nxtn marked this pull request as draft June 25, 2020 09:44
@buddhikac96 buddhikac96 changed the title Update CLI (GSoC - 2020) New CLI (GSoC - 2020) Jul 7, 2020
When user not specified a command explicitly in CMD, WinSW autoatically call default command. ConsoleMode and ServiceMode is decide by default command. If command is default WinSW in Service Mode and if comand is not the default command WinSW is in Console Mode
Add abstract Run method to CliOption and implement in all subclasses of CliOption class
Decouple install command from program
Add install command to InstallOption
Remove unnessacary methods from Program class

Switch not completetly removed and after decoupling all commands switch will be removed.
Remove Uninstall command from Program class and add to UninstallOption class
@buddhikac96 buddhikac96 requested a review from nxtn July 9, 2020 06:36
Remove Start logic from Program class and add to StartOption class.
Remove Stop comand logics from Program class and add to StopOption class
src/Core/ServiceWrapper/CLI/CliOption.cs Outdated Show resolved Hide resolved
src/Core/ServiceWrapper/CLI/StopWaitOption.cs Outdated Show resolved Hide resolved
src/Core/ServiceWrapper/CLI/TestWaitOption.cs Outdated Show resolved Hide resolved
src/Test/winswTests/winswTests.csproj Outdated Show resolved Hide resolved
src/Core/ServiceWrapper/CLI/TestOption.cs Outdated Show resolved Hide resolved
src/Core/ServiceWrapper/winsw.csproj Outdated Show resolved Hide resolved
src/Core/ServiceWrapper/winsw.csproj Outdated Show resolved Hide resolved
src/Core/ServiceWrapper/winsw.csproj Outdated Show resolved Hide resolved
src/Core/ServiceWrapper/CLI/CliOption.cs Outdated Show resolved Hide resolved
src/Core/ServiceWrapper/CLI/InstallOption.cs Outdated Show resolved Hide resolved
CliOption changed into CLICommand
Add mistakenly removed net40 support.
Remove StopWait and TestWait commands and implment as wait option to respect command.
GetCustomAttribute<VerbAttribute> is not net40 support.  Update Loadverbs to net40 support and could be removed in V3
Update logics for invalid command. Previously it was not possible to parse both invalid command and 0 commands.
@oleg-nenashev
Copy link
Member

IIUC it would be better to re-target this pull request towards v3

@nxtn
Copy link
Contributor

nxtn commented Jul 20, 2020

I thought this was for v2?

@oleg-nenashev
Copy link
Member

I thought this was for v2?

Well, we still have an issue with .NET Framework 2.0 support and incompatible CLI changes here. Moving it to v3 would resolve these concerns alltogether

@buddhikac96 buddhikac96 changed the base branch from master to v3 July 20, 2020 20:22
@buddhikac96 buddhikac96 marked this pull request as ready for review July 20, 2020 20:23
@Legion2
Copy link

Legion2 commented Aug 20, 2020

Can winsw be installed globally in PATH on the system and used as a CLI to install multiple services?

@buddhikac96
Copy link
Contributor Author

buddhikac96 commented Aug 20, 2020

Can winsw be installed globally in PATH on the system and used as a CLI to install multiple services?

Yes. But you need to have a separate configuration file for each service that you going to install and after this New CLI feature released then you can specify the configuration file explicitly in the command line interface. Until that, your configuration file should be located in the same directory where WinSW executable is located or in an ancestor directory. That means technically until this gets released you have to manually manage configuration files by renaming or save in a separate folder. Hope this helps!

@buddhikac96 buddhikac96 changed the title New CLI (GSoC - 2020) New CLI Aug 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gsoc In the scope for Google Summer of Code
Development

Successfully merging this pull request may close these issues.

None yet

4 participants