Orchard为许多在管理面板中可用的和不可用的功能的命令行接口。命令行工具名称是 “orchard.exe”,在网站根目录下bin目录中。

Using Commands

要查看可用的命令,输入help commands。

orchard> help commands
List of available commands:
---------------------------blog create /Slug:<slug> /Title:<title> /Owner:<username> [/MenuText:<menu text>]Creates a new Blogblog import /Slug:<slug> /FeedUrl:<feed url> /Owner:<username>Import all items from <feed url> into the blog at the specified <slug>cultures get site cultureGet culture for the sitecultures listList site culturescultures set site culture <culture-name>Set culture for the sitefeature disable <feature-name-1> ... <feature-name-n>Disable one or more featuresfeature enable <feature-name-1> ... <feature-name-n>Enable one or more featuresfeature list [/Summary:true|false]Display list of available featureshelp <command>Display help text for <command>help commandsDisplay help text for all available commandspackage create <extensionName> <path>Create a package for the extension <extensionName>(an extension being a module or a theme).The package will be output at the <path> specified.The default filename is Orchard.[Module|Theme].<extensionName>.<extensionVersion>.nupkg.For example, "package create SampleModule c:\temp" will create the package"c:\temp\Orchard.Module.SampleModule.1.0.0.nupkg".package install <packageId> <location> /Version:<version>Install a module or a theme from a package file.package uninstall <packageId>Uninstall a module or a theme.The <packageId> should take the format Orchard.[Module|Theme].<extensionName>.For example, "package uninstall Orchard.Module.SampleModule" will uninstall the Module under the "~/Modules/SampleModule" directory and"package uninstall Orchard.Theme.SampleTheme" will uninstall the Theme under the "~/Themes/SampleTheme" directory.user create /UserName:<username> /Password:<password> /Email:<email>Creates a new User

可用的命令依赖网站中启用的功能。输入feature list可以列出功能列表,并且可以禁用和启用相应的功能。在命令行输入feature enable/disable <feature-name>,启用或禁用

orchard> feature list /Summary:true
Common, Enabled
Containers, Enabled
Contents, Enabled
Dashboard, Enabled
DatabaseUpdate, Disabled
Feeds, Enabled
Gallery, Enabled
HomePage, Enabled
Lucene, Disabled
Navigation, Enabled
Orchard.ArchiveLater, Disabled
Orchard.Blogs, Enabled
Orchard.Blogs.RemotePublishing, Disabled
Orchard.CodeGeneration, Enabled
Orchard.Comments, Enabled
Orchard.ContentTypes, Enabled
Orchard.Email, Disabled
Orchard.Experimental, Disabled
Orchard.Experimental.TestingLists, Disabled
Orchard.Experimental.WebCommandLine, Disabled
Orchard.Indexing, Disabled
Orchard.jQuery, Enabled
Orchard.Lists, Enabled
Orchard.Localization, Disabled
Orchard.Media, Enabled
Orchard.Messaging, Disabled
Orchard.Migrations, Disabled
Orchard.Modules, Enabled
Orchard.MultiTenancy, Disabled
Orchard.Packaging, Enabled
Orchard.Pages, Enabled
Orchard.PublishLater, Enabled
Orchard.Roles, Enabled
Orchard.Scripting, Enabled
Orchard.Scripting.Dlr, Disabled
Orchard.Scripting.Lightweight, Enabled
Orchard.Search, Disabled
Orchard.Setup, Disabled
Orchard.Tags, Enabled
Orchard.Themes, Enabled
Orchard.Users, Enabled
Orchard.Widgets, Enabled
PackagingServices, Enabled
Profiling, Disabled
Reports, Enabled
Routable, Enabled
SafeMode, Disabled
Scheduling, Enabled
Settings, Enabled
Shapes, Enabled
TheAdmin, Disabled
TheThemeMachine, Enabled
TinyMce, Enabled
XmlRpc, Disabled

Adding Commands

模块开发者能添加自己的命令,需要从Orchard.Commands.DefaultOrchardCommandHandler实现一个新类。一个命令就是一个类中的拥有CommandName特性的方法。下面创建hello world命令:

[CommandName("hello world")]
[CommandHelp(@"hello world <name> [/YouRock:true|false]
Says hello and whether you rock or not.")]
[OrchardSwitches("YouRock")]
public void HelloWorld(string name) {Context.Output.WriteLine(T("Hello {0}.", name ?? "world"));Context.Output.WriteLine(YouRock ? "You rock." : "You do not rock.");
}

The switch itself is declared as a property of the class:

[OrchardSwitch]
public bool YouRock { get; set; }

转载于:https://www.cnblogs.com/ibrady/archive/2012/03/20/2408060.html

四、管理网站(一) Using the command line interface相关推荐

  1. [Warning] Using a password on the command line interface can be insecure.

    mysql: [Warning] Using a password on the command line interface can be insecure. 来自TMySQL用户,包括很多开发和G ...

  2. MySQL 5.6 Warning - Using a password on the command line interface can be insecur 解决方案

    MySQL 5.6 Warning - Using a password on the command line interface can be insecur 解决方案 参考文章: (1)MySQ ...

  3. SAP Fiori Tools 和对应的 CLI (Command Line Interface)

    帮助文档地址:https://help.sap.com/viewer/product/SAP_FIORI_tools/Latest/en-US SAP Fiori 工具提供了许多功能来提高使用 SAP ...

  4. 命令行导出和导入数据库 How to export and import MySQL database using command line Interface...

    导出 : To export MySQL database, open putty on Windows or Terminal in either MAC or Linux OS, Go to th ...

  5. mysql备份时过滤掉某些库 以及 去掉Warning: Using a password on the command line interface can be insecure.提示信息...

    在对mysql进行完整备份时使用--all-database参数 # mysqldump -u root -h localhost -p --all-database > /root/all.s ...

  6. MySQL 基准测试(mysqlslap)出现 Using a password on the command line interface can be insecure 警告

    问题描述:在使用 mysqlslap 进行基准测试时,出现警告 mysqlslap: [Warning] Using a password on the command line interface ...

  7. 已解决:mysql: [Warning] Using a password on the command line interface can be insecure.

    在执行命令时候报错 mysql: [Warning] Using a password on the command line interface can be insecure. 解决 将密码改为后 ...

  8. Using a password on the command line interface can be insecure.

    使用mysqldump遇到报错 mysqldump: [Warning] Using a password on the command line interface can be insecure. ...

  9. MySQL 5.6 警告信息 command line interface can be insec

    MySQL 5.6 警告信息 command line interface can be insecure 修复 在命令行输入密码,就会提示这些安全警告信息. Warning: Using a pas ...

  10. 登录mysql时遇到了:mysql: [Warning] Using a password on the command line interface can be insecure.

    登录mysql时遇到了:mysql: [Warning] Using a password on the command line interface can be insecure. 问题: [ro ...

最新文章

  1. Scala程序设计:Java虚拟机多核编程实战(国内第一本Scala图书)
  2. CUDA8.0+VS2015+Win10开发环境搭建教程
  3. java+mysql中文乱码问题
  4. 学习笔记-小甲鱼Python3学习第九讲:了不起的分支和循环3
  5. Android简单调用相机Camera功能,实现打开照相功能
  6. Mac下安装jdk,并编写hello world
  7. 【JS】引用类型之RegExp
  8. MVC的自定义动作过滤器(一)
  9. PTA 硬币找钱问题
  10. Percent百分比布局用法
  11. 拉着老公,逛了一趟绿源电动车连锁店,喜提新座驾。
  12. 微信小程序开屏动画组件封装以及使用示例
  13. 抓取新浪微博好友昵称和性别
  14. 微信小程序开发学习记录(一):直播功能
  15. Google MapReduce论文中文版
  16. 推荐几款实用的PDF文件压缩大小软件,还不快码住
  17. 制作多维度分组交叉销售统计表
  18. MySQL8.0安装失败
  19. factorial of n
  20. 开关电源的共模干扰抑制技术

热门文章

  1. 连接超时这种异常怎么处理比较好_Golang中SSH.NewSession超时问题记录
  2. confirm修改按钮文字_CAD教程来袭,CAD菜鸟们你知道CAD如何创建和设置文字样式吗?...
  3. ifconfig没有命令 kali_新装的Linux系统没有ifconfig命令?教你一键找回
  4. es存在某个字段的查阅_ElasticSearch系列02:ES基础概念详解
  5. Python中的[:n],[::n],[:,:,n],[...,n]介绍
  6. Word中大括号内公式如何左对齐
  7. 构造post_用requests构造简单请求
  8. sizebox模型下载_css 盒模型、box-sizing 学习笔记
  9. 人工智能人才争抢白热化?学好数学才能C位出道
  10. python中.whl文件下载,pandas