# Commandline Optionvalue not displayed when using special characters

**URL:** <https://discourse.mcneel.com/t/commandline-optionvalue-not-displayed-when-using-special-characters/211253>\
**Category:** Rhino Developer\
**Tags:** windows, command\
**Created:** [October 21, 2025, 11:24am UTC](https://discourse.mcneel.com/t/commandline-optionvalue-not-displayed-when-using-special-characters/211253 "2025-10-21T11:24:47Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![tobias.stoltmann](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/tobias.stoltmann/32/772248_2.png) [@tobias.stoltmann](https://discourse.mcneel.com/u/tobias.stoltmann)\
**Post date:** [October 21, 2025, 11:24am UTC](https://discourse.mcneel.com/t/commandline-optionvalue-not-displayed-when-using-special-characters/211253/1 "2025-10-21T11:24:47Z")

</div>

Hi there,

I am creating a command, using options.

When I try to display the current value in the commandline options, the option is disappearing completely.

```auto
string variable = “#04”;
OptionToggle optionReplacee = new OptionToggle(false, variable, “OnValue”);

```

Does the commandline have restrictions for special characters like “#”?

Thanks,  
T.

---

<div class="post-metadata">

**Author:** ![nathanletwory](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/nathanletwory/32/482880_2.png) [@nathanletwory](https://discourse.mcneel.com/u/nathanletwory)\
**Post date:** [October 21, 2025, 11:37am UTC](https://discourse.mcneel.com/t/commandline-optionvalue-not-displayed-when-using-special-characters/211253/2 "2025-10-21T11:37:03Z")

</div>

I can’t quickly find it documented but as far as I know only letters and digits are allowed. If I’m not mistaken that is because characters other than those I mentioned have often special meaning on the command-line (see [Rhino scripting | Rhino 3-D modeling](https://docs.mcneel.com/rhino/8/help/en-us/information/rhinoscripting.htm) ). That is also why you can’t have spaces in there.

---

<div class="post-metadata">

**Author:** ![tobias.stoltmann](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/tobias.stoltmann/32/772248_2.png) [@tobias.stoltmann](https://discourse.mcneel.com/u/tobias.stoltmann)\
**Post date:** [October 21, 2025, 11:46am UTC](https://discourse.mcneel.com/t/commandline-optionvalue-not-displayed-when-using-special-characters/211253/3 "2025-10-21T11:46:39Z")

</div>

@nathanletwory, thanks.  
So the strategy to make it visible then is to add a character in front.  
I tried “(”, but it also does not work.  
Is there an overview which special characters might work?

---

<div class="post-metadata">

**Author:** ![nathanletwory](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/nathanletwory/32/482880_2.png) [@nathanletwory](https://discourse.mcneel.com/u/nathanletwory)\
**Post date:** [October 21, 2025, 4:30pm UTC](https://discourse.mcneel.com/t/commandline-optionvalue-not-displayed-when-using-special-characters/211253/4 "2025-10-21T16:30:15Z")

</div>

There is no clear documentation but the link I posted about Rhino scripting along with [`IsValidOptionName`](https://developer.rhino3d.com/api/rhinocommon/rhino.input.custom.commandlineoption/isvalidoptionname) and [`IsValidOptionValueName`](https://developer.rhino3d.com/api/rhinocommon/rhino.input.custom.commandlineoption/isvalidoptionvaluename) will help you figuring out what can cannot be used.

Additionally, under the hood, these are some of the functions that do checks on validity:

```c
static bool IsValidCommandNameLetter( wchar_t c )
{
  return ( (c >= 'a' && c <= 'z') || ( c >= 'A' && c <= 'Z' ) || c >= 128 );
}

static bool IsValidCommandNameFirstChar( wchar_t c )
{
  return ( IsValidCommandNameLetter(c) || (c >= '0' && c <= '9') );
}

static bool IsValidCommandNameSecondChar( wchar_t c )
{
  return ( IsValidCommandNameFirstChar(c) || c == '_' );
}

static bool IsValidOptionValueFirstChar( wchar_t c )
{
  return ( IsValidCommandNameFirstChar(c) || c == '.' || c == '+' || c == '-' );
}

static bool IsValidOptionValueSecondChar( wchar_t c )
{
  return ( c > 32 && c != 127 && c != '(' && c != ')' );
}

```

That together with the Rhino scripting documentation should get you going for now.

---

<div class="post-metadata">

**Author:** ![tobias.stoltmann](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/tobias.stoltmann/32/772248_2.png) [@tobias.stoltmann](https://discourse.mcneel.com/u/tobias.stoltmann)\
**Post date:** [October 22, 2025, 10:10pm UTC](https://discourse.mcneel.com/t/commandline-optionvalue-not-displayed-when-using-special-characters/211253/5 "2025-10-22T22:10:46Z")

</div>

Thanks a lot, @nathanletwory!
