-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
More command-line argument additions.
Rename upload and download verbs to push and get. Add additional argument aliases, rename exclude/include arguments, and add explicit add/remove for dependencies and DLC. Rewrite README.md with better organization, and links. Enforce dependencies as workshop mods.
- Loading branch information
1 parent
c8a40e3
commit ec7e8c4
Showing
11 changed files
with
702 additions
and
282 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
using CommandLine; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
|
||
namespace Phoenix.WorkshopTool.Options | ||
{ | ||
[Verb("change", HelpText = "Push metadata changes to workshop items (tags, thumbnail, etc.)")] | ||
public class ChangeVerb : PublishVerbBase | ||
{ } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
using CommandLine; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
|
||
namespace Phoenix.WorkshopTool.Options | ||
{ | ||
public abstract class PublishVerbBase : UGCOptionBase | ||
{ | ||
[Option('d', "dry-run", Default = false, HelpText = "Only run a test, do not actually upload")] | ||
public bool DryRun { get; set; } | ||
[Option('d', "dryrun", Default = false, HelpText = "Only run a test, do not actually upload", Hidden = true)] | ||
public bool Dry_Run { get => DryRun; set => DryRun = DryRun || value; } | ||
|
||
[Option("description", HelpText = "File containing the description to set for workshop item", MetaValue = "<filename>")] | ||
public string DescriptionFile { get; set; } | ||
|
||
[Option("visibility", Default = null, HelpText = "Sets mod visibility (defaults: current for existing, Private for new)")] | ||
public PublishedFileVisibility? Visibility { get; set; } | ||
|
||
[Option("thumb", HelpText = "Thumbnail to upload (doesn't re-upload mod)", MetaValue = "<filename>")] | ||
public string Thumbnail { get; set; } | ||
|
||
[Option("dependencies", HelpText = "Specify dependencies to other mods. Use 0 to remove all.", MetaValue = "<id>")] | ||
public IEnumerable<string> Dependencies { get; set; } | ||
|
||
// Provide aliases for add-dependency and remove-dependency, as add-dependencies and remove-dependencies, respectively | ||
protected IList<string> _dependenciesToAdd = new List<string>(); | ||
[Option("add-dependency", HelpText = "List of dependencies to add", Hidden = true)] | ||
public IEnumerable<string> DependencyToAdd { get => _dependenciesToAdd; set => value?.ForEach(t => _dependenciesToAdd.Add(t)); } | ||
[Option("add-dependencies", HelpText = "List of dependencies to add")] | ||
public IEnumerable<string> DependenciesToAdd { get => _dependenciesToAdd; set => value?.ForEach(t => _dependenciesToAdd.Add(t)); } | ||
|
||
protected IList<string> _dependenciesToRemove = new List<string>(); | ||
[Option("remove-dependency", HelpText = "List of dependencies to remove", Hidden = true)] | ||
public IEnumerable<string> DependencyToRemove { get => _dependenciesToRemove; set => value?.ForEach(t => _dependenciesToRemove.Add(t)); } | ||
[Option("remove-dependencies", HelpText = "List of dependencies to remove")] | ||
public IEnumerable<string> DependenciesToRemove { get => _dependenciesToRemove; set => value?.ForEach(t => _dependenciesToRemove.Add(t)); } | ||
|
||
internal bool TagsSpecified => Tags != null || TagsToAdd != null || TagsToRemove != null; | ||
|
||
[Option("tags", HelpText = "List of workshop mod categories/tags to use (overwrites previous, default: keep)")] | ||
public IEnumerable<string> Tags { get; set; } | ||
|
||
// Provide aliases for add-tag and remove-tag, as add-tags and remove-tags, respectively | ||
protected IList<string> _tagsToAdd = new List<string>(); | ||
[Option("add-tag", HelpText = "List of workshop categories/tags to add", Hidden = true)] | ||
public IEnumerable<string> TagToAdd { get => _tagsToAdd; set => value?.ForEach(t => _tagsToAdd.Add(t)); } | ||
[Option("add-tags", HelpText = "List of workshop categories/tags to add")] | ||
public IEnumerable<string> TagsToAdd { get => _tagsToAdd; set => value?.ForEach(t => _tagsToAdd.Add(t)); } | ||
|
||
protected IList<string> _tagsToRemove = new List<string>(); | ||
[Option("remove-tag", HelpText = "List of workshop categories/tags to remove", Hidden = true)] | ||
public IEnumerable<string> TagToRemove { get => _tagsToRemove; set => value?.ForEach(t => _tagsToRemove.Add(t)); } | ||
[Option("remove-tags", HelpText = "List of workshop categories/tags to remove")] | ||
public IEnumerable<string> TagsToRemove { get => _tagsToRemove; set => value?.ForEach(t => _tagsToRemove.Add(t)); } | ||
|
||
#if SE | ||
[Option("dlc", HelpText = "Add DLC dependency to mod, accepts numeric ID or name. Use 0 or None to remove all.")] | ||
#endif | ||
public IEnumerable<string> DLCs { get; set; } | ||
|
||
[Option("add-dlc", HelpText = "Add DLC dependency to mod.")] | ||
public IEnumerable<string> DLCToAdd { get; set; } | ||
|
||
[Option("remove-dlc", HelpText = "Remove DLC dependency from mod.")] | ||
public IEnumerable<string> DLCToRemove { get; set; } | ||
|
||
[Option("blueprints", Min = 1, Group = "workshop", HelpText = "List of folder names of blueprints")] | ||
public IEnumerable<string> Blueprints { get; set; } | ||
|
||
[Option("scenarios", Min = 1, Group = "workshop", HelpText = "List of folder names of scenarios")] | ||
public IEnumerable<string> Scenarios { get; set; } | ||
|
||
[Option("worlds", Min = 1, Group = "workshop", HelpText = "List of folder names of worlds")] | ||
public IEnumerable<string> Worlds { get; set; } | ||
} | ||
} |
Oops, something went wrong.