Age | Commit message (Collapse) | Author |
|
|
|
Added -t:library since mcd does not interpret output filename for dll suffix.
Without -t:library option, it fails to compile.
{code}
mono$ mcs -debug+ -r:System.Core Options.cs -o:Mono.Options.dll
error CS5001: Program `Options.exe' does not contain a static `Main' method suitable for an entry point
Compilation failed: 1 error(s), 0 warnings
{code}
|
|
|
|
the AssemblyKeyFile attribute for consistency and to make it easier to do path name manipulation on the file name. (#5316)
|
|
* [Mono.Options] Fix test and add suite to CI
We missed running Mono.Options tests on CI so we didn't catch
this error which was introduced with: https://github.com/mono/mono/pull/4719
```
CSC [net_4_x-darwin] net_4_x_Mono.Options_test.dll
Test/Mono.Options/CommandSetTest.cs(231,16): error CS7036: There is no argument given that corresponds to the required formal parameter 'error' of 'CommandSet.CommandSet(string, TextWriter, TextWriter, Converter<string, string>)'
```
* [Mono.Options] Stop hardcoding \n to fix tests on Windows
|
|
|
|
When `PCL` is defined, the intent is that the resulting
`Mono.Options.dll` assembly will be usable on all PCL profiles.
This includes "silly" profiles such as Profile259, which lacks the
`System.Console` type, meaning e.g. `Console.Out` doesn't exist.
Unfortunately, the
`CommandSet(string, Converter<string, string, TextWriter, TextWriter)`
constructor would use `Console.Out` and `Console.Error` when the
`TextWriter` parameters were `null`, meaning this constructor can't
be provided for all PCL profiles.
Altering the constructor to instead use `TextWriter.Null` would allow
the constructor to be provided, but would be a *worse* experience,
IMHO: anybody (everybody!) expecting the default values to
"do something useful" will be sorely disappointed, as output and
error messages would instead be dropped. :-(
Instead, remove this constructor:
public CommandSet (string suite, MessageLocalizerConverter localizer = null, TextWriter output = null, TextWriter error = null);
and replace it with these *two* constructors:
public CommandSet (string suite, MessageLocalizerConverter localizer = null)
public CommandSet (string suite, TextWriter output, TextWriter error, MessageLocalizerConverter localizer = null)
The first constructor, which accepts no `TextWriter` parameters, is
only provided in non-PCL builds, allowing it to use `Console.Out`.
The second constructor is available in PCL profiles, and *requires*
that `output` and `error` be non-`null`.
Documentation has been updated accordingly.
|
|
|
|
It was missed in c1b9fc566a365cf6923218eae9098d0fd0e632ae
|
|
|
|
Mono.Options.CommandSet allows easily having separate commands and
associated command options, allowing creation of a *suite* along the
lines of **git**(1), **svn**(1), etc.
CommandSet allows intermixing plain text strings for `--help` output,
Option values -- as supported by OptionSet -- and Command instances,
which have a name, optional help text, and an optional OptionSet.
var suite = new CommandSet ("suite-name") {
// Use strings and option values, as with OptionSet
"usage: suite-name COMMAND [OPTIONS]+",
{ "v:", "verbosity", (int? v) => Verbosity = v.HasValue ? v.Value : Verbosity+1 },
// Commands may also be specified
new Command ("command-name", "command help") {
Options = new OptionSet {/*...*/},
Run = args => { /*...*/},
},
new MyCommandSubclass (),
};
suite.Run (new string[]{...});
CommandSet provides a `help` command, and forwards `help COMMAND`
to the registered Command instance by invoking Command.Invoke()
with `--help` as an option.
|
|
|
|
|
|
Note: DISABLE_CAS_USE was removed in ed989a8e9e5c170b6d19edc60bb80e8a4e6d5cc0
|
|
|
|
to appease MS msbuild
|
|
cyclic assemblies
|
|
|
|
* Adds support for a handful of new command line arguments that we now use in the build.
* Always attempts to match to a project name, to get the proper project dependency.
* Update to support .exe and .dll in the generation.
* Remove warnings and some dead code
* Update the resulting csproj files based on running:
make update-csproj
make package-inputs
mono genproj.exe
|
|
use full path.
One of csc prerequisites because csc uses -lib as path which is considered after
RuntimeEnvironment.GetRuntimeDirectory which makes -lib useless
|
|
- Support for String to Enum
- Support for Number to Enum
- Support for Flags to Enum
- Added a UnitTest
|
|
- TypeDescriptor is unavailable, but basic conversion can be done using IConvertible
|
|
They weren't updated in the last 6 years and aren't helpful anymore (e.g. by causing unrelated matches during git grep searches).
|
|
We only use the net_4_x profile now so those csproj's don't make sense anymore.
|
|
|
|
- Explictly disable warning CS0618 for Options.cs in Mono.Options
|
|
bf66c00bc7379c71de1669799a1801ec7174c7df
|
|
|
|
reduce duplication.
|
|
variable which lists the assemblies a given assembly depends on to build.
|
|
|
|
|
|
|
|
A couple of the test suites didn't follow the MonoTests.<namespace of class under test> naming convention for the namespace.
|
|
|
|
|
|
|
|
|
|
mono(1) supports a "joined" verbose flag, `mono -v-v-v-v`, which
Mono.Options doesn't support. Attempting to use it, however, resulted
in a "weird" error message:
$ csharp -r:Mono.Options.dll
csharp> using Mono.Options;
csharp> var p = new OptionSet { { "v", v => {} } };
csharp> p.Parse (new[]{"-v-v-v"});
Mono.Options.OptionException: Cannot bundle unregistered option '--'.
...
This looks very weird to users because they never used a "--" option,
and if they had then `--` would have disabled further option
processing (as documented and implemented in OptionSet.Parse()).
Confusion all around.
Improve the error message so that it instead generates:
Mono.Options.OptionException: Cannot use unregistered option '-' in bundle '-v-v-v'.
That way the user gets the full context of where this "unregistered
option" came from.
|
|
|
|
|
|
|
|
|
|
WriteOptionDescriptions).
|
|
|
|
|
|
|
|
|
|
|
|
|