Question: Some very nice people here helped me write the code snippet below. And the code works great
it prints out the correct subtext, and have a optional argument by typing `*` 

```
\documentclass[10pt,a4paper]{article}
\newcounter{problem}
\setcounter{problem}{0}
\newcounter{alternative}
\setcounter{alternative}{0}
\newif\iffirstalt
\usepackage{xparse}

\NewDocumentCommand{\Oppgave}{s m}{%
  \IfBooleanTF{#1}%
     {\stepcounter{alternative}\iffirstalt\else\stepcounter{problem}\firstalttrue\fi}%
     {\setcounter{alternative}{0}\stepcounter{problem}\firstaltfalse}%
  \section*{Oppgave \arabic{problem}%
             {\normalfont\IfBooleanTF{#1}{~Alternative \Roman{alternative}\ }{}
                \normalsize (#2 poeng)}%
   \addcontentsline{toc}{section}{Oppgave \arabic{problem} }} 
}
\begin{document}

\tableofcontents

\oppgaveS{3}

\oppgaveS{4}

\oppgaveS*{2}

\oppgaveS*{2}

\oppgaveS{3}

\oppgaveS*{2}

\end{document}    

```

Is there any possibility to add zero optional inputs? I mean so that i can write 

```
\Oppgave and \Oppgave*

```

To be displayed as

**Oppgave 1** and **Oppgave 1 Alternativ 1**

I just want to have no small text, if I just plainly write the command =)

Answer: 
The following requires a small modification to your input. Instead of using `\oppgaveS*{<num>}`, use `\oppgaveS*[<num>]`:

![enter image description here](https://i.stack.imgur.com/ljzRJ.png)

```
\documentclass[10pt,a4paper]{article}
\newcounter{problem} %\setcounter{problem}{0}
\newcounter{alternative} %\setcounter{alternative}{0}
\newif\iffirstalt
\usepackage{xparse}% http://ctan.org/pkg/xparse

\NewDocumentCommand{\oppgaveS}{s o}{%
  \IfBooleanTF{#1}%
   {\stepcounter{alternative}\iffirstalt\else\stepcounter{problem}\firstalttrue\fi}%
   {\setcounter{alternative}{0}\stepcounter{problem}\firstaltfalse}%
  \section*{Oppgave~\arabic{problem}~%
    {\normalfont\IfBooleanTF{#1}{Alternative \Roman{alternative}~}{}}%
                \IfNoValueTF{#2}{}{\normalfont\normalsize (#2 poeng)}}%
   \addcontentsline{toc}{section}{Oppgave~\arabic{problem}} 
}
\begin{document}

\tableofcontents

\oppgaveS[3]
\oppgaveS[4]
\oppgaveS*[2]
\oppgaveS*[2]
\oppgaveS[3]
\oppgaveS*[2]
\oppgaveS*
\oppgaveS*[3]
\oppgaveS
\oppgaveS
\oppgaveS*
\end{document}

```

The optional argument specification `o` from [`xparse`](http://ctan.org/pkg/xparse) takes the value `\NoValue` if it is empty (when using `\oppgaveS` or `\oppgaveS*`), and conditioned upon using `\IfNoValueTF`.
If I understand you correctly, you want to be able to say `\Oppgave` and that should be the same as `\Oppgave{1}` and `\Oppgave*` to be the same as `\Oppgave*{1}`

If so, you can just replace the line 

```
\NewDocumentCommand{\Oppgave}{s m}{%

```

with

```
\NewDocumentCommand{\Oppgave}{s O{1}}{%

```

Then the first parameter (`#2` since the `s` represents a `*` which is considered `#1`) is optional and will take on a value of `{1}` if not specified. The portion with the `{}` is the default value if a parameter is not specified.

From [the `xparse` documentation](http://www.ctan.org/pkg/xparse), you can define optional arguments with either a lower case `o`, or an upper case `O`:

> 
> `o` A standard LaTeX optional argument, surrounded with square brackets, which will
>  supply the special `\NoValue` token if not given.
> 
> 
> `O` As for `o`, but returns `{default}` if no value is given. Should be given as `O{default}`.
> 
> 
> 

if you want to be able to use `{}` for the optional args you should use

> 
> `g` An optional argument given inside a pair of TEX group tokens (in standard LATEX, `{}`), which returns `\NoValue` if not present.
> 
> 
> `G` As for g but returns `default` if no value is given: `G{default`}`.
> 
> 
> 

The MWE you provided was using the `m` option which is documented as:

> 
> `m` A standard mandatory argument, which can either be a single token alone or multiple tokens surrounded by curly braces. Regardless of the input, the argument will be passed to the internal code surrounded by a brace pair. This is the xparse type specifier for a normal TEX argument.
> 
> 
>