Skip to content

Commit 8d6284c

Browse files
CopilotmarcpopMSFT
andcommitted
Add --os option to dotnet restore command
Co-authored-by: marcpopMSFT <[email protected]>
1 parent d7a7d93 commit 8d6284c

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

documentation/manpages/sdk/dotnet-restore.1

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ dotnet-restore - Restores the dependencies and tools of a project.
2626
.IP
2727
.nf
2828
\f[C]
29-
dotnet restore [<ROOT>] [--configfile <FILE>] [--disable-build-servers]
29+
dotnet restore [<ROOT>] [-a|--arch <ARCHITECTURE>] [--configfile <FILE>] [--disable-build-servers]
3030
[--disable-parallel]
3131
[-f|--force] [--force-evaluate] [--ignore-failed-sources]
3232
[--interactive] [--lock-file-path <LOCK_FILE_PATH>] [--locked-mode]
33-
[--no-cache] [--no-dependencies] [--packages <PACKAGES_DIRECTORY>]
33+
[--no-cache] [--no-dependencies] [--os <OS>] [--packages <PACKAGES_DIRECTORY>]
3434
[-r|--runtime <RUNTIME_IDENTIFIER>] [-s|--source <SOURCE>]
3535
[--tl:[auto|on|off]] [--use-current-runtime, --ucr [true|false]]
3636
[--use-lock-file] [-v|--verbosity <LEVEL>]
@@ -144,6 +144,15 @@ If you use this option, don\[cq]t use the \f[V]-r|--runtime\f[R] option.
144144
Available since .NET 6 Preview 7.
145145
.RE
146146
.IP \[bu] 2
147+
\f[B]\f[VB]--os <OS>\f[B]\f[R]
148+
.RS 2
149+
.PP
150+
Specifies the target operating system (OS).
151+
This is a shorthand syntax for setting the Runtime Identifier (RID), where the provided value is combined with the default RID.
152+
For example, on a \f[V]win-x64\f[R] machine, specifying \f[V]--os linux\f[R] sets the RID to \f[V]linux-x64\f[R].
153+
If you use this option, don\[cq]t use the \f[V]-r|--runtime\f[R] option.
154+
.RE
155+
.IP \[bu] 2
147156
\f[B]\f[VB]--configfile <FILE>\f[B]\f[R]
148157
.RS 2
149158
.PP

src/Cli/dotnet/Commands/Restore/RestoreCommandParser.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ private static Command ConstructCommand()
7373
}
7474

7575
command.Options.Add(CommonOptions.ArchitectureOption);
76+
command.Options.Add(CommonOptions.OperatingSystemOption);
7677
command.SetAction(RestoreCommand.Run);
7778

7879
return command;

0 commit comments

Comments
 (0)