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

WIP: Separate args for each command #551

Merged
merged 9 commits into from
Jan 19, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
119 changes: 119 additions & 0 deletions src/Paket/Commands.fs
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
module Paket.Commands

open Nessos.UnionArgParser

type Command =
| [<First>][<CustomCommandLine("add")>] Add
| [<First>][<CustomCommandLine("config")>] Config
| [<First>][<CustomCommandLine("convert-from-nuget")>] ConvertFromNuget
| [<First>][<CustomCommandLine("find-refs")>] FindRefs
| [<First>][<CustomCommandLine("init")>] Init
| [<First>][<CustomCommandLine("init-auto-restore")>] InitAutoRestore
| [<First>][<CustomCommandLine("install")>] Install
| [<First>][<CustomCommandLine("outdated")>] Outdated
| [<First>][<CustomCommandLine("remove")>] Remove
| [<First>][<CustomCommandLine("restore")>] Restore
| [<First>][<CustomCommandLine("simplify")>] Simplify
| [<First>][<CustomCommandLine("update")>] Update
with
interface IArgParserTemplate with
member __.Usage = ""

type GlobalArgs =
| [<AltCommandLine("-v")>] Verbose
| Log_File of string
with
interface IArgParserTemplate with
member __.Usage = ""

type AddArgs =
| [<First>][<CustomCommandLine("nuget")>][<Mandatory>] Nuget of string
| [<CustomCommandLine("version")>] Version of string
| [<AltCommandLine("-f")>] Force
| [<AltCommandLine("-i")>] Interactive
| Hard
| No_Install
with
interface IArgParserTemplate with
member __.Usage = ""

type ConfigArgs =
| [<CustomCommandLine("add-credentials")>] AddCredentials of string
with
interface IArgParserTemplate with
member __.Usage = ""

type ConvertFromNugetArgs =
| [<AltCommandLine("-f")>] Force
| No_Install
| No_Auto_Restore
| Creds_Migration of string
with
interface IArgParserTemplate with
member __.Usage = ""

type FindRefsArgs =
| [<Rest>][<CustomCommandLine("nuget")>][<Mandatory>] Packages of string
with
interface IArgParserTemplate with
member __.Usage = ""

type InitArgs =
| [<Hidden>] NoArg
with
interface IArgParserTemplate with
member __.Usage = ""

type InitAutoRestoreArgs =
| [<Hidden>] NoArg
with
interface IArgParserTemplate with
member __.Usage = ""

type InstallArgs =
| [<AltCommandLine("-f")>] Force
| Hard
| Redirects
with
interface IArgParserTemplate with
member __.Usage = ""

type OutdatedArgs =
| Ignore_Constraints
| [<AltCommandLine("--pre")>] Include_Prereleases
with
interface IArgParserTemplate with
member __.Usage = ""

type RemoveArgs =
| [<First>][<CustomCommandLine("nuget")>][<Mandatory>] Nuget of string
| [<AltCommandLine("-f")>] Force
| [<AltCommandLine("-i")>] Interactive
| Hard
| No_Install
with
interface IArgParserTemplate with
member __.Usage = ""

type RestoreArgs =
| [<AltCommandLine("-f")>] Force
| [<Rest>] References_Files of string
with
interface IArgParserTemplate with
member __.Usage = ""

type SimplifyArgs =
| [<AltCommandLine("-i")>] Interactive
with
interface IArgParserTemplate with
member __.Usage = ""

type UpdateArgs =
| [<First>][<CustomCommandLine("nuget")>] Nuget of string
| [<CustomCommandLine("version")>] Version of string
| [<AltCommandLine("-f")>] Force
| Hard
| Redirects
with
interface IArgParserTemplate with
member __.Usage = ""
2 changes: 1 addition & 1 deletion src/Paket/HelpTexts.fs
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ This will add the package to the selected paket.references files and also to the
Text = """Finds all project files that have the given NuGet packages installed.

[lang=batchfile]
$ paket find-refs PACKAGENAME1 PACKAGENAME1 ...
$ paket find-refs nuget PACKAGENAME1 PACKAGENAME1 ...

## Sample

Expand Down
1 change: 1 addition & 0 deletions src/Paket/Paket.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
<ItemGroup>
<Compile Include="AssemblyInfo.fs" />
<Compile Include="HelpTexts.fs" />
<Compile Include="Commands.fs" />
<Compile Include="Program.fs" />
<Content Include="App.config" />
<None Include="paket.references" />
Expand Down
Loading