feat: add dde-am fields support#282
feat: add dde-am fields support#282xzl01 wants to merge 1 commit intolinuxdeepin:masterfrom xzl01:master
Conversation
|
Skipping CI for Draft Pull Request. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: xzl01 The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Reviewer's GuideThis PR introduces support for launch fields in dde-am by enhancing the CLI parser to accept a new --fields option and arguments after “--”, refactoring positional-argument handling, and extending the Launcher class to store and pass these fields over D-Bus. Sequence diagram for CLI argument parsing and field handlingsequenceDiagram
actor User
participant CLI as dde-am main
participant Parser
participant Launcher
User->>CLI: Run dde-am --fields foo -- appId bar
CLI->>Parser: Preprocess args (handle --, --fields)
Parser->>CLI: Return parsed appId, action, envVars, fields
CLI->>Launcher: setFields(fields)
CLI->>Launcher: setEnvironmentVariables(envVars)
CLI->>Launcher: setAction(action)
CLI->>Launcher: run()
Launcher->>D-Bus: Launch(appId, action, fields, envVars)
Updated class diagram for Launcher with fields supportclassDiagram
class Launcher {
+void setAction(QString action)
+void setLaunchedType(LaunchedType type)
+void setEnvironmentVariables(QStringList envVars)
+void setFields(QStringList fields)
+DExpected<void> run()
+static DExpected<QStringList> appIds()
-QString m_path
-QString m_action
-LaunchedType m_launchedType
-QStringList m_environmentVariables
-QStringList m_fields
}
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
| QCommandLineOption envOption(QStringList() << "e" << "env", | ||
| "Set environment variable, format: NAME=VALUE (can be used multiple times)", "env"); | ||
| parser.addOption(envOption); | ||
| QCommandLineOption fieldsOption(QStringList() << "f" << "fields", |
There was a problem hiding this comment.
fields使用addPositionalArgument会有什么问题么?
| void setAction(const QString &action); | ||
| void setLaunchedType(LaunchedType type); | ||
| void setEnvironmentVariables(const QStringList &envVars); | ||
| void setFields(const QStringList &fields); // 新增 |
|
跟@BLumia 讨论过,兼容action和支持field分开做可能比较好, |
|
TAG Bot New tag: 1.2.33 |
|
TAG Bot New tag: 1.2.34 |
Log:
Summary by Sourcery
Add support for specifying arbitrary launch fields in dde-am, including a CLI option and proper DBus handling.
New Features:
Enhancements: