Skip to content
This repository was archived by the owner on Aug 29, 2025. It is now read-only.

Commit 8437ae9

Browse files
authored
Merge pull request #4 from microsoftgraph/feat/program_entry_point
Add program entry point for CLI
2 parents 5c4aa67 + 0e87f27 commit 8437ae9

File tree

6 files changed

+118
-0
lines changed

6 files changed

+118
-0
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
nuget.config
2+
obj/
3+
bin/

.vscode/launch.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"name": ".NET Core Launch (console)",
9+
"type": "coreclr",
10+
"request": "launch",
11+
"preLaunchTask": "build",
12+
"program": "${workspaceFolder}/src/bin/Debug/net6.0/msgraph-cli.dll",
13+
"args": [],
14+
"cwd": "${workspaceFolder}",
15+
"console": "internalConsole",
16+
"stopAtEntry": false
17+
},
18+
{
19+
"name": ".NET Core Attach",
20+
"type": "coreclr",
21+
"request": "attach"
22+
}
23+
]
24+
}

.vscode/tasks.json

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
{
2+
"version": "2.0.0",
3+
"tasks": [
4+
{
5+
"label": "build",
6+
"command": "dotnet",
7+
"type": "process",
8+
"args": [
9+
"build",
10+
"${workspaceFolder}/src/msgraph-cli.csproj",
11+
"/property:GenerateFullPaths=true",
12+
"/consoleloggerparameters:NoSummary"
13+
],
14+
"problemMatcher": "$msCompile"
15+
},
16+
{
17+
"label": "publish",
18+
"command": "dotnet",
19+
"type": "process",
20+
"args": [
21+
"publish",
22+
"${workspaceFolder}/src/msgraph-cli.csproj",
23+
"/property:GenerateFullPaths=true",
24+
"/consoleloggerparameters:NoSummary"
25+
],
26+
"problemMatcher": "$msCompile"
27+
},
28+
{
29+
"label": "watch",
30+
"command": "dotnet",
31+
"type": "process",
32+
"args": [
33+
"watch",
34+
"run",
35+
"${workspaceFolder}/src/msgraph-cli.csproj",
36+
"/property:GenerateFullPaths=true",
37+
"/consoleloggerparameters:NoSummary"
38+
],
39+
"problemMatcher": "$msCompile"
40+
}
41+
]
42+
}

msgraph-cli.sln

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 16
4+
VisualStudioVersion = 16.0.30114.105
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "msgraph-cli", "src\msgraph-cli.csproj", "{C1EC92B0-6508-4582-B9A9-8B1BEE2B55D7}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|Any CPU = Debug|Any CPU
11+
Release|Any CPU = Release|Any CPU
12+
EndGlobalSection
13+
GlobalSection(SolutionProperties) = preSolution
14+
HideSolutionNode = FALSE
15+
EndGlobalSection
16+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
17+
{C1EC92B0-6508-4582-B9A9-8B1BEE2B55D7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
18+
{C1EC92B0-6508-4582-B9A9-8B1BEE2B55D7}.Debug|Any CPU.Build.0 = Debug|Any CPU
19+
{C1EC92B0-6508-4582-B9A9-8B1BEE2B55D7}.Release|Any CPU.ActiveCfg = Release|Any CPU
20+
{C1EC92B0-6508-4582-B9A9-8B1BEE2B55D7}.Release|Any CPU.Build.0 = Release|Any CPU
21+
EndGlobalSection
22+
EndGlobal

src/Program.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
using System.CommandLine;
2+
3+
namespace Microsoft.Graph.Cli
4+
{
5+
class Program {
6+
static async Task<int> Main(string[] args) {
7+
var rootCommand = new RootCommand(); // TODO: Replace with root command from generated client
8+
rootCommand.Description = "Microsoft Graph CLI";
9+
return await rootCommand.InvokeAsync(args);
10+
}
11+
}
12+
}

src/msgraph-cli.csproj

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFramework>net6.0</TargetFramework>
6+
<RootNamespace>msgraph_cli</RootNamespace>
7+
<ImplicitUsings>enable</ImplicitUsings>
8+
<Nullable>enable</Nullable>
9+
</PropertyGroup>
10+
11+
<ItemGroup>
12+
<PackageReference Include="System.CommandLine" Version="2.0.0-beta1.21308.1" />
13+
</ItemGroup>
14+
15+
</Project>

0 commit comments

Comments
 (0)