Displaying 5 results from an estimated 5 matches for "add_defaults_to_set".
2014 Jan 09
2
Re: [Bug 1046905] New: RFE: add argument to virt-sysprep to disable individual default operations
...urally as ...
let n, remove =
if string_prefix op_name "-" then
String.sub op_name 1 (String.length op_name-1), true
else
op_name, false in
match n with
...
> + let f = if remove then Sysprep_operation.remove_defaults_from_set else Sysprep_operation.add_defaults_to_set in
> + f opset
You can actually write:
(if remove then Sysprep_operation.remove_defaults_from_set
else Sysprep_operation.add_defaults_to_set) opset
I don't know which way you think is clearer, but I would avoid the >80
character lines.
> + "--operations",...
2014 Jan 13
2
Re: [Bug 1046905] New: RFE: add argument to virt-sysprep to disable individual default operations
...ng_prefix op_name "-" then
> `Remove (String.sub op_name 1 (String.length op_name-1))
> else
> `Add op_name
> match op with
>
> | `Add "" | `Remove "" -> (* error *)
> | `Add "defaults" -> Sysprep_operation.add_defaults_to_set opset
> | `Remove "defaults" -> Sysprep_operation.remove_defaults_from_set
> | opset etc
>
> The type of op will be [ `Add of string | `Remove of string ].
> Actually you never need to write that type out, as OCaml will infer it
> (and check it). It will only...
2014 Jan 13
0
[PATCH] sysprep: add --operations
...+ else
+ `Add op_name in
+ match op with
+ | `Add "" | `Remove "" ->
+ eprintf (f_"%s: --operations: empty operation name\n")
+ prog;
+ exit 1
+ | `Add "defaults" -> Sysprep_operation.add_defaults_to_set opset
+ | `Remove "defaults" -> Sysprep_operation.remove_defaults_from_set opset
+ | `Add "all" -> Sysprep_operation.add_all_to_set opset
+ | `Remove "all" -> Sysprep_operation.remove_all_from_set opset
+ | `Add n | `Remove n ->...
2014 Jan 07
2
Re: [Bug 1046905] New: RFE: add argument to virt-sysprep to disable individual default operations
On Tuesday 07 January 2014 12:12:43 Richard W.M. Jones wrote:
> On Tue, Jan 07, 2014 at 11:16:08AM +0100, Pino Toscano wrote:
> > On Friday 27 December 2013 10:58:15 you wrote:
> > > virt-sysprep either runs with all default operations or a selected
> > > list of operations with the --enable argument. A few times I've
> > > found I'd like to use the
2014 Jan 10
0
Re: [Bug 1046905] New: RFE: add argument to virt-sysprep to disable individual default operations
...ite this is:
let op =
if string_prefix op_name "-" then
`Remove (String.sub op_name 1 (String.length op_name-1))
else
`Add op_name
match op with
| `Add "" | `Remove "" -> (* error *)
| `Add "defaults" -> Sysprep_operation.add_defaults_to_set opset
| `Remove "defaults" -> Sysprep_operation.remove_defaults_from_set opset
| etc
The type of op will be [ `Add of string | `Remove of string ].
Actually you never need to write that type out, as OCaml will infer it
(and check it). It will only appear in error messages if yo...