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

Commit cd0035a

Browse files
committed
Add program entry point for CLI
1 parent 5c4aa67 commit cd0035a

File tree

6 files changed

+140
-0
lines changed

6 files changed

+140
-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: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
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+
"WARNING01": "*********************************************************************************",
12+
"WARNING02": "The C# extension was unable to automatically decode projects in the current",
13+
"WARNING03": "workspace to create a runnable launch.json file. A template launch.json file has",
14+
"WARNING04": "been created as a placeholder.",
15+
"WARNING05": "",
16+
"WARNING06": "If OmniSharp is currently unable to load your project, you can attempt to resolve",
17+
"WARNING07": "this by restoring any missing project dependencies (example: run 'dotnet restore')",
18+
"WARNING08": "and by fixing any reported errors from building the projects in your workspace.",
19+
"WARNING09": "If this allows OmniSharp to now load your project then --",
20+
"WARNING10": " * Delete this file",
21+
"WARNING11": " * Open the Visual Studio Code command palette (View->Command Palette)",
22+
"WARNING12": " * run the command: '.NET: Generate Assets for Build and Debug'.",
23+
"WARNING13": "",
24+
"WARNING14": "If your project requires a more complex launch configuration, you may wish to delete",
25+
"WARNING15": "this configuration and pick a different template using the 'Add Configuration...'",
26+
"WARNING16": "button at the bottom of this file.",
27+
"WARNING17": "*********************************************************************************",
28+
"preLaunchTask": "build",
29+
"program": "${workspaceFolder}/bin/Debug/net6.0/msgraph-cli.dll",
30+
"args": [],
31+
"cwd": "${workspaceFolder}",
32+
"console": "internalConsole",
33+
"stopAtEntry": false
34+
},
35+
{
36+
"name": ".NET Core Attach",
37+
"type": "coreclr",
38+
"request": "attach"
39+
}
40+
]
41+
}

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

src/msgraph-cli.csproj

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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="Microsoft.Extensions.DependencyInjection" Version="6.0.0" />
13+
<PackageReference Include="Microsoft.Extensions.Hosting" Version="6.0.0" />
14+
<PackageReference Include="Microsoft.Extensions.Logging" Version="6.0.0" />
15+
<PackageReference Include="System.CommandLine" Version="2.0.0-beta1.21308.1" />
16+
</ItemGroup>
17+
18+
</Project>

0 commit comments

Comments
 (0)