[lxc-devel] [lxd/master] Add yaml-mode marker in template for "lxc edit" actions.
albertodonato on Github
lxc-bot at linuxcontainers.org
Wed Apr 26 08:58:39 UTC 2017
A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 432 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20170426/8b225c27/attachment.bin>
-------------- next part --------------
From ac3847a13c19e828a70757ab9a5efc428b37568f Mon Sep 17 00:00:00 2001
From: Alberto Donato <alberto.donato at canonical.com>
Date: Wed, 26 Apr 2017 10:54:58 +0200
Subject: [PATCH] Add yaml-mode marker in template for "lxc edit" actions.
---
lxc/config.go | 4 +++-
lxc/image.go | 6 ++++--
lxc/network.go | 4 +++-
lxc/profile.go | 4 +++-
lxc/storage.go | 8 ++++++--
5 files changed, 19 insertions(+), 7 deletions(-)
diff --git a/lxc/config.go b/lxc/config.go
index 7be59ac..d34e6bb 100644
--- a/lxc/config.go
+++ b/lxc/config.go
@@ -34,7 +34,9 @@ func (c *configCmd) flags() {
}
func (c *configCmd) configEditHelp() string {
- return i18n.G(
+ return `### -*- mode:yaml -*-
+###
+` + i18n.G(
`### This is a yaml representation of the configuration.
### Any line starting with a '# will be ignored.
###
diff --git a/lxc/image.go b/lxc/image.go
index 0b02bce..0f3d40b 100644
--- a/lxc/image.go
+++ b/lxc/image.go
@@ -49,8 +49,10 @@ func (c *imageCmd) showByDefault() bool {
}
func (c *imageCmd) imageEditHelp() string {
- return i18n.G(
- `### This is a yaml representation of the image properties.
+ return `### -*- mode:yaml -*-
+###
+` + i18n.G(
+ `### This is a yaml representation of the image properties.
### Any line starting with a '# will be ignored.
###
### Each property is represented by a single line:
diff --git a/lxc/network.go b/lxc/network.go
index 920a67e..b2c46f3 100644
--- a/lxc/network.go
+++ b/lxc/network.go
@@ -26,7 +26,9 @@ func (c *networkCmd) showByDefault() bool {
}
func (c *networkCmd) networkEditHelp() string {
- return i18n.G(
+ return `### -*- mode:yaml -*-
+###
+` + i18n.G(
`### This is a yaml representation of the network.
### Any line starting with a '# will be ignored.
###
diff --git a/lxc/profile.go b/lxc/profile.go
index 70221a4..75ce81b 100644
--- a/lxc/profile.go
+++ b/lxc/profile.go
@@ -25,7 +25,9 @@ func (c *profileCmd) showByDefault() bool {
}
func (c *profileCmd) profileEditHelp() string {
- return i18n.G(
+ return `### -*- mode:yaml -*-
+###
+` + i18n.G(
`### This is a yaml representation of the profile.
### Any line starting with a '# will be ignored.
###
diff --git a/lxc/storage.go b/lxc/storage.go
index 365ca5d..cdcefb1 100644
--- a/lxc/storage.go
+++ b/lxc/storage.go
@@ -27,7 +27,9 @@ func (c *storageCmd) showByDefault() bool {
}
func (c *storageCmd) storagePoolEditHelp() string {
- return i18n.G(
+ return `### -*- mode:yaml -*-
+###
+` + i18n.G(
`### This is a yaml representation of a storage pool.
### Any line starting with a '# will be ignored.
###
@@ -44,7 +46,9 @@ func (c *storageCmd) storagePoolEditHelp() string {
}
func (c *storageCmd) storagePoolVolumeEditHelp() string {
- return i18n.G(
+ return `### -*- mode:yaml -*-
+###
+` + i18n.G(
`### This is a yaml representation of a storage volume.
### Any line starting with a '# will be ignored.
###
More information about the lxc-devel
mailing list