smlsharp has the following execution modes.
When smlsharp is invoked without any parameter, it executes the interactive session.
When smlsharp is invoked with a single source file as shown below:
$ smlsharp file.sml
$
it compiles the source file file.sml, links the resulting object file and creates an executable program (with the name a.out by default).
When smlsharp is invoked with -c switch as shown below:
$ smlsharp -c file1.sml fileN.sml
$
it compiles the given files file1.sml fileN.sml into object files file1.o fileN.o.
When smlsharp is invoked with a single interface files as shown below:
$ smlsharp file.smi
$
it assumes that file.smi is a top-level interface file, links all the object files corresponding to the interface files referenced from file.smi, and generates an executable file.
SML# also recognizes various command-line switches.
$ smlsharp --help
will print a help message describing available switches.