mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-22 04:34:59 +00:00
refactor: commandline parsing
* `--rebase-todo-editor` launches this app as a git `sequence.editor` * `--rebase-message-editor` launches this app as a git `core.editor` which runs on background by reading rebasing jobs * `--core-editor` launches this app as a git `core.editor` * `--askpass` launches this app as a SSH askpass program
This commit is contained in:
parent
cbe4c36525
commit
6930b51c64
14 changed files with 320 additions and 155 deletions
|
@ -28,21 +28,20 @@ namespace SourceGit.ViewModels
|
|||
}
|
||||
}
|
||||
|
||||
public Launcher(string[] commandlines)
|
||||
public Launcher(string startupRepo)
|
||||
{
|
||||
Pages = new AvaloniaList<LauncherPage>();
|
||||
AddNewTab();
|
||||
|
||||
if (commandlines.Length == 2)
|
||||
if (!string.IsNullOrEmpty(startupRepo))
|
||||
{
|
||||
var path = commandlines[1];
|
||||
var root = new Commands.QueryRepositoryRootPath(path).Result();
|
||||
var root = new Commands.QueryRepositoryRootPath(startupRepo).Result();
|
||||
if (string.IsNullOrEmpty(root))
|
||||
{
|
||||
Pages[0].Notifications.Add(new Notification
|
||||
{
|
||||
IsError = true,
|
||||
Message = $"Given path: '{path}' is NOT a valid repository!"
|
||||
Message = $"Given path: '{startupRepo}' is NOT a valid repository!"
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue